Fixed the bug with Dijkstra's