Fixed an improper calculation in allocator