Fixed a bug in the settings restore and reset