Fix crash in the pref dialog.