fix shortest paths