Fix bug in textFieldDidEndEditing.