0540: another fix for nearest waypoint

#253