Fixed problems when waypoints are spliced and, in particular, removed.