fixed allocator bugs
FIXME