Fix APPPATH
diff --git a/index.php b/index.php
index 380d101..ad98013 100644
--- a/index.php
+++ b/index.php
@@ -211,7 +211,7 @@
 	// The path to the "application" folder
 	if (is_dir($application_folder))
 	{
-		if (($_temp = realpath($system_path)) !== FALSE)
+		if (($_temp = realpath($application_folder)) !== FALSE)
 		{
 			$application_folder = $_temp;
 		}
@@ -256,7 +256,7 @@
 		$view_folder = rtrim($view_folder, '/').'/';
 	}
 
-	define ('VIEWPATH', $view_folder);
+	define('VIEWPATH', $view_folder);
 
 /*
  * --------------------------------------------------------------------