A physical order batch retrieval with a filter did not always return all the expected records. When called using a physical order batch retrieval combined with a record filter (mode parameter included both BAT_PHYS and BAT_VERIFY), DoBatchXtd() (used by ctdbSetBatch() and related APIs) sometimes terminated when the first record excluded by the filter was encountered. In some cases, an internal error was not properly cleared, causing the batch call to return with fewer records than expected. The logic has been modified to correct this.