Deleted element in selection list

This PR fixes issue 29471 which was caused by the stem to be deleted but not removed from the selection list.