Make waypoint setting more robust.