Added distributed batch allocator test; fixed bug.