fix Heap#foreach