fixed bugs in polygon_path_finder for finding nearest points