Bug fix in Basic Dijkstra