Setting preferences and switching profile.