Keep the Waypoint Ids stable. Fixes #2341

Is based on release and can be merged into release.