Fixed small problems with the heap