Fix problems with rename and selection.