diff --git a/server/lib/classes/system.inc.php b/server/lib/classes/system.inc.php
index b1f91033091e24a69fd6fc171066e89a245487fc..5b666752aa4670c53a374f92511a3cd1fb49168a 100644
--- a/server/lib/classes/system.inc.php
+++ b/server/lib/classes/system.inc.php
@@ -699,7 +699,7 @@ class system{
 		}
 	}
 	
-	function unlink($file) {
+	function unlink($filename) {
 		if(file_exists($filename)) {
 			return unlink($filename);
 		}
diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php
index a111dd658f31e1e5e53c25dda9e5e65fc3c69355..f56d375b066c270c5c4c2600e053988e736981f4 100644
--- a/server/plugins-available/apache2_plugin.inc.php
+++ b/server/plugins-available/apache2_plugin.inc.php
@@ -1452,7 +1452,7 @@ class apache2_plugin {
 		$app->uses('system');
 		$web_config = $app->getconf->get_server_config($conf['server_id'], 'web');
 		
-		$app->system->web_folder_protection($data['new']['document_root'],false);
+		$app->system->web_folder_protection($data['old']['document_root'],false);
 
 		//* Check if this is a chrooted setup
 		if($web_config['website_basedir'] != '' && @is_file($web_config['website_basedir'].'/etc/passwd')) {