Added esc key closing windows.
Fixed problem with Preference window not re-opening.