Closing the window when a file is unsaved now throws the AskSave dialog box. Also fixed issue with pressing 'cancel' on the 'Save As' prompt.