Save preferences.