Fixed the saving of prefs bug.