Fix a problem with undoing a deselect