Fix bug in prefs