Fixes for meanShortestPath()