Pathfinder: better error checking