Fix a potentially disastrous MapExit bug. Move end game code and fix some issues with the menu.