Fix a few exceptions and add an Exit menu item