Fixed NullpointerException when PreferenceActivity was created. fixes #275