Fixed bug in detecting press of the Enter key