Fix traceback in text.removeSelection()