Fix various issues in CAllocatorImpl
Merge pull request #4 from Hackerpilot/allocator

Fix various issues in CAllocatorImpl