Fix to save configuration when exit with 'Quit' menuitem