Better logic in Pathfinder::getBestPaths.