Improved allocator.c to return the right pointer