Fixes for issue 896
diff --git a/system/core/Common.php b/system/core/Common.php
index 6ef2296..1f59c02 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -235,7 +235,7 @@
 		}
 
 		// Is the config file in the environment folder?
-		if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT..'/config.php'))
+		if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/config.php'))
 		{
 			$file_path = APPPATH.'config/config.php';
 		}
diff --git a/system/core/Output.php b/system/core/Output.php
index 1beee73..da5c290 100755
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -129,7 +129,6 @@
 	 *
 	 * Sets the output string
 	 *
-	 * @access	public
 	 * @param	string
 	 * @return	void
 	 */
@@ -282,7 +281,7 @@
 	 * @param	integer
 	 * @return	void
 	 */
-	publi function cache($time)
+	public function cache($time)
 	{
 		$this->cache_expiration = ( ! is_numeric($time)) ? 0 : $time;
 		return $this;
diff --git a/system/core/URI.php b/system/core/URI.php
index eaf7b75..b28ee19 100755
--- a/system/core/URI.php
+++ b/system/core/URI.php
@@ -186,11 +186,12 @@
 			return '';
 		}
 
-		if (strpos($_SERVER['REQUEST_URI'], $_SERVER['SCRIPT_NAME']) === 0)
+		$uri = $_SERVER['REQUEST_URI'];
+		if (strpos($uri, $_SERVER['SCRIPT_NAME']) === 0)
 		{
 			$uri = substr($uri, strlen($_SERVER['SCRIPT_NAME']));
 		}
-		elseif (strpos($_SERVER['REQUEST_URI'], dirname($_SERVER['SCRIPT_NAME'])) === 0)
+		elseif (strpos($uri, dirname($_SERVER['SCRIPT_NAME'])) === 0)
 		{
 			$uri = substr($uri, strlen(dirname($_SERVER['SCRIPT_NAME'])));
 		}