Fixed restore code to include global prefs.