Index: includes/module.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/module.inc,v
retrieving revision 1.163
diff -u -r1.163 module.inc
--- includes/module.inc	30 Oct 2009 21:54:45 -0000	1.163
+++ includes/module.inc	31 Oct 2009 11:55:41 -0000
@@ -353,7 +353,11 @@ module_implements($hook, $sort
  * @see module_implements_write_cache().
  */
 function module_implements($hook, $sort = FALSE, $reset = FALSE) {
-  $implementations = &drupal_static(__FUNCTION__, array());
+  static $cache = array();
+  if (!isset($cache['implementations'])) {
+   $cache['implementations'] = &drupal_static(__FUNCTION__, array());
+  }
+  $implementations = &$cache['implementations'];
 
   // We maintain a persistent cache of hook implementations in addition to the
   // static cache to avoid looping through every module and every hook on each
Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.316
diff -u -r1.316 bootstrap.inc
--- includes/bootstrap.inc	30 Oct 2009 22:33:35 -0000	1.316
+++ includes/bootstrap.inc	31 Oct 2009 11:55:41 -0000
@@ -2021,7 +2021,8 @@ drupal_static($name, $default_value
   // Reset a single value, or all values.
   if ($reset) {
     if (isset($name)) {
-      unset($data[$name]);
+      $data[$name] = NULL; // Set data to NULL
+      unset($data[$name]); // Remove reference
     }
     else {
       $data = array();
