Fixed bug which crashed the program if a user pressed tab in an input field