fixed batchDistance minimum finding #2292