Adjustments in static reference handling
diff --git a/system/core/Common.php b/system/core/Common.php
index 6b3d731..cf9cd84 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -228,11 +228,7 @@
 	{
 		static $_config;
 
-		if (isset($_config))
-		{
-			$config =& $_config[0];
-		}
-		else
+		if (empty($_config))
 		{
 			$file_path = APPPATH.'config/config.php';
 			$found = FALSE;
@@ -262,16 +258,17 @@
 				exit(EXIT_CONFIG);
 			}
 
+			// references cannot be directly assigned to static variables, so we use an array
 			$_config[0] =& $config;
 		}
 
 		// Are any values being dynamically added or replaced?
 		foreach ($replace as $key => $val)
 		{
-			$config[$key] = $val;
+			$_config[0][$key] = $val;
 		}
 
-		return $config;
+		return $_config[0];
 	}
 }
 
@@ -439,7 +436,7 @@
 	{
 		static $_log;
 
-		if ($_log === NULL)
+		if (empty($_log))
 		{
 			// references cannot be directly assigned to static variables, so we use an array
 			$_log[0] =& load_class('Log', 'core');