Fix InvalidMemoryOperationError in DebugAllocator

This fixes errors which fail unit tests when using DebugAllocator.
Yes this is probably part of an interface issue. I'll remove it