diff --git a/core/Config/IniFileChain.php b/core/Config/IniFileChain.php
index c8e63f4fbef5dbb551e269955ecee33093386449..d8b4e4e28bd6adce4a6f6beafa50b1236703e764 100644
--- a/core/Config/IniFileChain.php
+++ b/core/Config/IniFileChain.php
@@ -141,7 +141,7 @@ class IniFileChain
 
         $configToWrite = array();
         foreach ($this->mergedSettings as $sectionName => $changedSection) {
-            if(isset($existingMutableSection[$sectionName])){
+            if(isset($existingMutableSettings[$sectionName])){
                 $existingMutableSection = $existingMutableSettings[$sectionName];
             } else{
                 $existingMutableSection = array();
diff --git a/tests/PHPUnit/Unit/ConfigTest.php b/tests/PHPUnit/Unit/ConfigTest.php
index 1ab5b5ffa561ef5dbb4c9a76bb25b646b5fbffdc..d92e1525b61d5e68216f5906f5d1aab5999c77cc 100644
--- a/tests/PHPUnit/Unit/ConfigTest.php
+++ b/tests/PHPUnit/Unit/ConfigTest.php
@@ -379,7 +379,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
         $configFile = PIWIK_INCLUDE_PATH . '/tmp/tmp.config.ini.php';
 
         if(file_exists($configFile)){
-            unlink($configFile);
+            @unlink($configFile);
         }
         copy($sourceConfigFile, $configFile);
 
@@ -389,7 +389,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals(file_get_contents($sourceConfigFile), file_get_contents($configFile));
 
         if(file_exists($configFile)){
-            unlink($configFile);
+            @unlink($configFile);
         }
     }