Made sure prefs unit tests don't fail
Prefs: Use local variable for caching rather than a global one