critical fix to Heap and PriorityQueue