Fixes crash when opening preference activities.