Fix crash in the pref dialog.
Merge pull request #65 from ahmedcharles/crash

Fix crash in the pref dialog.