Fix saving of settings