Changed the way the state is saved in the Settings view.