switch the last couple of things to using the block heap allocator and fix a memory leak