Fix style errors; generalize ShortestPath type signature