Fix crash when getting out of waypoints.