I believe I have completely fixed my modified Dijkstra's algorithm.