Heap: fix omissions in GC algorithm