Saving settings to user defaults.