Improve semantic errors for allShortestPaths