JAL-674 patch for duplicate row bug