Graph: fix Dijkstra termination condition, added bigger test