VX(Be): Fix the Dijkstra algorithm, added unit tests for it.