The user input handling code has been improved.