Fix bug in handling of Esc key in IE