Fix generation of test batches