Fixed minor bug in text editing