Fixed potential NPE in Prefs.