Fix inconsistent behavior in moveSelectionRight.