Fixed prefs and code