fix up the Firefox close button bug, fix up keyboard shortcut bug for changing modes