Finally fixed the persistence of settings.