Fixed camera crash and shared prefs