diff --git a/includes/theme.inc b/includes/theme.inc
index 9b606e9fb1..b590b8223f 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -418,7 +418,7 @@ class ThemeRegistry Extends DrupalCacheArray {
     // are not registered, just check the existence of the key in the registry.
     // Use array_key_exists() here since a NULL value indicates that the theme
     // hook exists but has not yet been requested.
-    return array_key_exists($offset, $this->storage);
+    return isset($this->storage[$offset]) || array_key_exists($offset, $this->storage);
   }
 
   public function offsetGet($offset) {
@@ -428,9 +428,7 @@ class ThemeRegistry Extends DrupalCacheArray {
     if (isset($this->storage[$offset])) {
       return $this->storage[$offset];
     }
-    elseif (array_key_exists($offset, $this->storage)) {
-      return $this->resolveCacheMiss($offset);
-    }
+    return $this->resolveCacheMiss($offset);
   }
 
   public function resolveCacheMiss($offset) {
