Fix bug in allocator.