Batch allocator now works with batch sizes which produce partial batches.