fixed a number of bugs in heap and dijkstra