Fix a potential bug with popping off multiple waypoints.