fixed bugs in polygon_path_finder for finding nearest points

fixed bugs in polygon_path_finder for finding nearest points