Fixed bug with KeyListener