Fixed bug in batch allocator.