diff --git includes/module.inc includes/module.inc
index ac32df9..12e1a29 100644
--- includes/module.inc
+++ includes/module.inc
@@ -6,15 +6,32 @@
  * API for loading and interacting with Drupal modules.
  */
 
-
 /**
  * Load all the modules that have been enabled in the system table.
+ * 
+ * @param $bootstrap
+ *   Whether to load only the reduced set of modules loaded in "bootstrap mode"
+ *   for cached pages. See bootstrap.inc.
+ * @return
+ *   If $bootstrap is NULL, return a boolean indicating whether all modules
+ *   have been loaded.
  */
 function module_load_all($bootstrap = FALSE) {
-  foreach (module_list(TRUE, $bootstrap) as $module) {
-    drupal_load('module', $module);
+  static $has_run = FALSE;
+
+  if (is_null($bootstrap)) {
+    return $has_run;
   }
-}
+  else {
+    foreach (module_list(TRUE, $bootstrap) as $module) {
+      drupal_load('module', $module);
+    }
+    if (!$bootstrap) {
+      $has_run = TRUE;
+    }
+  }
+ }
+
 
 /**
  * Collect a list of all loaded modules. During the bootstrap, return only
diff --git includes/theme.inc includes/theme.inc
index e300eb6..59f3ae4 100644
--- includes/theme.inc
+++ includes/theme.inc
@@ -258,7 +258,7 @@ function _theme_load_registry($theme, $base_theme = NULL, $theme_engine = NULL)
     $registry = _theme_build_registry($theme, $base_theme, $theme_engine);
    // Only persist this registry if all modules are loaded. This assures a 
    // complete set of theme hooks.
-    if (drupal_get_bootstrap_phase() == DRUPAL_BOOTSTRAP_FULL) {
+    if (module_load_all(NULL)) {
       _theme_save_registry($theme, $registry);
       _theme_set_registry($registry);
     }
