Index: /code/branches/buildsystem3/cmake/BuildConfigGCC.cmake
===================================================================
--- /code/branches/buildsystem3/cmake/BuildConfigGCC.cmake	(revision 2689)
+++ /code/branches/buildsystem3/cmake/BuildConfigGCC.cmake	(revision 2690)
@@ -56,4 +56,8 @@
 ENDIF()
 
+# For GCC older than version 4, do not display sign compare warings
+# because of boost::filesystem (which creates about a hundred per include)
+ADD_COMPILER_FLAGS("-Wno-sign-compare" GCC_NO_SYSTEM_HEADER_SUPPORT CACHE)
+
 # Increase warning level if requested
 IF(EXTRA_COMPILER_WARNINGS)
Index: /code/branches/buildsystem3/config/CMakeLists.txt
===================================================================
--- /code/branches/buildsystem3/config/CMakeLists.txt	(revision 2689)
+++ /code/branches/buildsystem3/config/CMakeLists.txt	(revision 2690)
@@ -20,77 +20,10 @@
 SET(ORXONOX_CONFIG_DEV_PATH ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
 
-SET(READ_ONLY_CONFIG_FILES
-  def_keybindings.ini
-  def_masterKeybindings.ini
-)
-
-SET(WRITABLE_CONFIG_FILES
-)
-
 IF(TARDIS)
   # OGRE can't find fonts to display config screen on Tardis,
   # so providing default config file here (bug).
-  LIST(APPEND WRITABLE_CONFIG_FILES ogre.cfg)
+  # Cause: Ogre 1.4.5 was compiled for an older debian version
+  IF(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ogre.cfg)
+    CONFIGURE_FILE(ogre.cfg ${CMAKE_CURRENT_BINARY_DIR}/ogre.cfg COPYONLY)
+  ENDIF()
 ENDIF(TARDIS)
-
-# We need the same code for both READ_ONLY and WRITABLE config files
-MACRO(CONFIGURE_FILES _file_name _build_configs _read_only_arg)
-  SET(_read_only ${_read_only_arg})
-  FOREACH(_build_config ${_build_configs})
-    # Is there an extra file in bin/Debug or bin/Release?
-    IF(${_build_config} MATCHES "Rel")
-      SET(_build_config_short "Release")
-    ELSE()
-      SET(_build_config_short "Debug")
-    ENDIF()
-    IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_build_config_short}/${_file_name})
-      SET(_in_file ${CMAKE_CURRENT_SOURCE_DIR}/${_build_config_short}/${_file_name})
-    ELSE()
-      SET(_in_file ${CMAKE_CURRENT_SOURCE_DIR}/${_file_name})
-    ENDIF()
-
-    # Copy to the folder named like the build config for Visual Studio
-    IF(CMAKE_CONFIGURATION_TYPES)
-      SET(_out_file ${CMAKE_CURRENT_BINARY_DIR}/${_build_config}/${_file_name})
-    ELSE()
-      SET(_out_file ${CMAKE_CURRENT_BINARY_DIR}/${_file_name})
-    ENDIF()
-    # Only copy if target file doesn't exist. This may result in problems but
-    # otherwise we might delete a user's config
-    IF(NOT EXISTS ${_out_file} OR _read_only)
-      CONFIGURE_FILE(${_in_file} ${_out_file} @ONLY)
-    ENDIF()
-  ENDFOREACH(_build_config)
-ENDMACRO(CONFIGURE_FILES)
-
-# Copy config files to all Visual Studio output directories
-IF(CMAKE_CONFIGURATION_TYPES)
-  SET(BUILD_CONFIGS ${CMAKE_CONFIGURATION_TYPES})
-ELSE()
-  SET(BUILD_CONFIGS ${CMAKE_BUILD_TYPE})
-ENDIF()
-
-FOREACH(_file_name ${READ_ONLY_CONFIG_FILES})
-  CONFIGURE_FILES("${_file_name}" "${BUILD_CONFIGS}" TRUE)
-ENDFOREACH(_file_name)
-FOREACH(_file_name ${WRITABLE_CONFIG_FILES})
-  CONFIGURE_FILES("${_file_name}" "${BUILD_CONFIGS}" FALSE)
-ENDFOREACH(_file_name)
-
-
-################ Installation #################
-
-# Not using collective call to allow configuration with CMake.
-FOREACH(_file ${READ_ONLY_CONFIG_FILES} ${WRITABLE_CONFIG_FILES})
-  IF(CMAKE_CONFIGURATION_TYPES)
-    FOREACH(_configuration ${CMAKE_CONFIGURATION_TYPES})
-      INSTALL(
-        FILES ${CMAKE_CURRENT_BINARY_DIR}/${_configuration}/${_file}
-        DESTINATION ${ORXONOX_CONFIG_INSTALL_PATH}
-        CONFIGURATIONS ${_configuration}
-      )
-    ENDFOREACH(_configuration)
-  ELSE()
-    INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_file} DESTINATION ${ORXONOX_CONFIG_INSTALL_PATH})
-  ENDIF()
-ENDFOREACH(_file)
Index: de/branches/buildsystem3/config/def_keybindings.ini
===================================================================
--- /code/branches/buildsystem3/config/def_keybindings.ini	(revision 2689)
+++ 	(revision )
@@ -1,167 +1,0 @@
-[Keys]
-KeyA="scale -1 moveRightLeft"
-KeyABNT_C1=
-KeyABNT_C2=
-KeyAT=
-KeyAX=
-KeyApostrophe=
-KeyApps=
-KeyB=
-KeyBack=
-KeyBackslash=
-KeyC=switchCamera
-KeyCalculator=
-KeyCapsLock=
-KeyColon=
-KeyComma=
-KeyConvert=
-KeyD="scale 1 moveRightLeft"
-KeyDelete=
-KeyDivide=
-KeyDown=
-KeyE="scale -1 rotateRoll"
-KeyEnd=
-KeyEquals=
-KeyEscape="exit"
-KeyF="scale -1 moveUpDown"
-KeyF1=
-KeyF10=
-KeyF11=
-KeyF12=
-KeyF13=
-KeyF14=
-KeyF15=
-KeyF2="OverlayGroup toggleVisibility Stats"
-KeyF3=
-KeyF4=
-KeyF5=
-KeyF6=
-KeyF7=
-KeyF8=
-KeyF9=
-KeyG=greet
-KeyGrave=
-KeyH=
-KeyHome=
-KeyI=
-KeyInsert=
-KeyJ=
-KeyK=
-KeyKana=
-KeyKanji=
-KeyL=dropItems
-KeyLeft=
-KeyLeftAlt=
-KeyLeftBracket=
-KeyLeftControl=mouseLook
-KeyLeftShift=
-KeyLeftWindows=
-KeyLessThan=
-KeyM=
-KeyMail=
-KeyMediaSelect=
-KeyMediaStop=
-KeyMinus=
-KeyMultiply=
-KeyMute=
-KeyMyComputer=
-KeyN=
-KeyNextTrack=
-KeyNoConvert=
-KeyNumLock=
-KeyNumRow0=
-KeyNumRow1=
-KeyNumRow2=
-KeyNumRow3=
-KeyNumRow4=
-KeyNumRow5=
-KeyNumRow6=
-KeyNumRow7=
-KeyNumRow8=
-KeyNumRow9=
-KeyNumpad0=
-KeyNumpad1=
-KeyNumpad2=
-KeyNumpad3=
-KeyNumpad4=
-KeyNumpad5=
-KeyNumpad6=
-KeyNumpad7=
-KeyNumpad8=
-KeyNumpad9=
-KeyNumpadAdd=
-KeyNumpadComma=
-KeyNumpadEnter=
-KeyNumpadEquals=
-KeyNumpadPeriod=
-KeyNumpadSubtract=
-KeyO=
-KeyP=
-KeyPageDown=
-KeyPageUp=
-KeyPause=pause
-KeyPeriod=
-KeyPlayPause=
-KeyPower=
-KeyPreviousTrack=
-KeyQ="scale 1 rotateRoll"
-KeyR="scale 1 moveUpDown"
-KeyReturn=
-KeyRight=
-KeyRightAlt=
-KeyRightBracket=
-KeyRightControl=
-KeyRightShift=
-KeyRightWindows=
-KeyS="scale -1 moveFrontBack"
-KeyScrollLock=
-KeySemicolon=
-KeySlash=
-KeySleep=
-KeySpace=boost
-KeyStop=
-KeySystemRequest=
-KeyT=
-KeyTab="cycleNavigationFocus"
-KeyU=
-KeyUP=
-KeyUnassigned=
-KeyUnderline=
-KeyUnlabeled=
-KeyV=
-KeyVolumeDown=
-KeyVolumeUp=
-KeyW="scale 1 moveFrontBack"
-KeyWake=
-KeyWebBack=
-KeyWebFavorites=
-KeyWebForward=
-KeyWebHome=
-KeyWebRefresh=
-KeyWebSearch=
-KeyWebStop=
-KeyX=
-KeyY=
-KeyYen=
-KeyZ=
-
-[MouseButtons]
-MouseButton3=
-MouseButton4=
-MouseButton5=
-MouseButton6=
-MouseButton7=
-MouseLeft="fire"
-MouseMiddle=
-MouseRight="altfire"
-MouseWheel1Down=
-MouseWheel1Up=
-MouseWheel2Down=
-MouseWheel2Up=
-
-[MouseAxes]
-MouseXNeg="scale -1 rotateYaw"
-MouseXPos="scale 1 rotateYaw"
-MouseYNeg="scale -1 rotatePitch"
-MouseYPos="scale 1 rotatePitch"
-
Index: de/branches/buildsystem3/config/def_masterKeybindings.ini
===================================================================
--- /code/branches/buildsystem3/config/def_masterKeybindings.ini	(revision 2689)
+++ 	(revision )
@@ -1,260 +1,0 @@
-[Keys]
-KeyA=
-KeyABNT_C1=
-KeyABNT_C2=
-KeyAT=
-KeyAX=
-KeyApostrophe=
-KeyApps=
-KeyB=
-KeyBack=
-KeyBackslash=
-KeyC=
-KeyCalculator=
-KeyCapsLock=
-KeyColon=
-KeyComma=
-KeyConvert=
-KeyD=
-KeyDelete=
-KeyDivide=
-KeyDown=
-KeyE=
-KeyEnd=
-KeyEquals=
-KeyEscape=
-KeyF=
-KeyF1="OverlayGroup toggleVisibility Debug"
-KeyF10=
-KeyF11=
-KeyF12=
-KeyF13=
-KeyF14=
-KeyF15=
-KeyF2=
-KeyF3=
-KeyF4=
-KeyF5=
-KeyF6=
-KeyF7=
-KeyF8=
-KeyF9=
-KeyG=
-KeyGrave="openConsole"
-KeyH=
-KeyHome=
-KeyI=
-KeyInsert=
-KeyJ=
-KeyK=
-KeyKana=
-KeyKanji=
-KeyL=
-KeyLeft=
-KeyLeftAlt=
-KeyLeftBracket=
-KeyLeftControl=
-KeyLeftShift=
-KeyLeftWindows=
-KeyLessThan=
-KeyM=
-KeyMail=
-KeyMediaSelect=
-KeyMediaStop=
-KeyMinus=
-KeyMultiply=
-KeyMute=
-KeyMyComputer=
-KeyN=
-KeyNextTrack=
-KeyNoConvert=
-KeyNumLock=
-KeyNumRow0=
-KeyNumRow1=
-KeyNumRow2=
-KeyNumRow3=
-KeyNumRow4=
-KeyNumRow5=
-KeyNumRow6=
-KeyNumRow7=
-KeyNumRow8=
-KeyNumRow9=
-KeyNumpad0=
-KeyNumpad1=
-KeyNumpad2=
-KeyNumpad3=
-KeyNumpad4=
-KeyNumpad5=
-KeyNumpad6=
-KeyNumpad7=
-KeyNumpad8=
-KeyNumpad9=
-KeyNumpadAdd=
-KeyNumpadComma=
-KeyNumpadEnter=
-KeyNumpadEquals=
-KeyNumpadPeriod=
-KeyNumpadSubtract=
-KeyO=
-KeyP=
-KeyPageDown=
-KeyPageUp=
-KeyPause=
-KeyPeriod=
-KeyPlayPause=
-KeyPower=
-KeyPreviousTrack=
-KeyQ=
-KeyR=
-KeyReturn=
-KeyRight=
-KeyRightAlt=
-KeyRightBracket=
-KeyRightControl=
-KeyRightShift=
-KeyRightWindows=
-KeyS=
-KeyScrollLock=
-KeySemicolon=
-KeySlash=
-KeySleep=
-KeySpace=
-KeyStop=
-KeySystemRequest=
-KeyT=
-KeyTab=
-KeyU=
-KeyUP=
-KeyUnassigned=
-KeyUnderline=
-KeyUnlabeled=
-KeyV=
-KeyVolumeDown=
-KeyVolumeUp=
-KeyW=
-KeyWake=
-KeyWebBack=
-KeyWebFavorites=
-KeyWebForward=
-KeyWebHome=
-KeyWebRefresh=
-KeyWebSearch=
-KeyWebStop=
-KeyX=
-KeyY=
-KeyYen=
-KeyZ=
-Key_084=
-Key_085=
-Key_089=
-Key_090=
-Key_091=
-Key_092=
-Key_093=
-Key_094=
-Key_095=
-Key_096=
-Key_097=
-Key_098=
-Key_099=
-Key_103=
-Key_104=
-Key_105=
-Key_106=
-Key_107=
-Key_108=
-Key_109=
-Key_110=
-Key_111=
-Key_112=
-Key_114=
-Key_115=
-Key_117=
-Key_118=
-Key_119=
-Key_120=
-Key_121=
-Key_123=
-Key_125=
-Key_128=
-Key_129=
-Key_130=
-Key_131=
-Key_132=
-Key_133=
-Key_134=
-Key_135=
-Key_136=
-Key_137=
-Key_138=
-Key_139=
-Key_140=
-Key_141=
-Key_143=
-Key_144=
-Key_154=
-Key_155=
-Key_158=
-Key_159=
-Key_163=
-Key_165=
-Key_166=
-Key_167=
-Key_168=
-Key_169=
-Key_170=
-Key_171=
-Key_172=
-Key_173=
-Key_175=
-Key_177=
-Key_180=
-Key_182=
-Key_185=
-Key_186=
-Key_187=
-Key_188=
-Key_189=
-Key_190=
-Key_191=
-Key_192=
-Key_193=
-Key_194=
-Key_195=
-Key_196=
-Key_198=
-Key_202=
-Key_204=
-Key_206=
-Key_212=
-Key_213=
-Key_214=
-Key_215=
-Key_216=
-Key_217=
-Key_218=
-Key_224=
-Key_225=
-Key_226=
-Key_228=
-
-[MouseButtons]
-MouseButton3=
-MouseButton4=
-MouseButton5=
-MouseButton6=
-MouseButton7=
-MouseLeft=
-MouseMiddle=
-MouseRight=
-MouseWheel1Down=
-MouseWheel1Up=
-MouseWheel2Down=
-MouseWheel2Up=
-
-[MouseAxes]
-MouseXNeg=
-MouseXPos=
-MouseYNeg=
-MouseYPos=
-
Index: /code/branches/buildsystem3/log/CMakeLists.txt
===================================================================
--- /code/branches/buildsystem3/log/CMakeLists.txt	(revision 2689)
+++ /code/branches/buildsystem3/log/CMakeLists.txt	(revision 2690)
@@ -19,12 +19,2 @@
  
 SET(ORXONOX_LOG_DEV_PATH ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
-
-# Create some directories for the logs or CEGUI crashes when setting up the log
-IF(CMAKE_CONFIGURATION_TYPES)
-  FOREACH(_configuration ${CMAKE_CONFIGURATION_TYPES})
-    FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_configuration})
-  ENDFOREACH(_configuration)
-ENDIF()
-
-# Also create the folder when installing
-INSTALL(CODE "FILE(MAKE_DIRECTORY \"${ORXONOX_LOG_INSTALL_PATH}\")")
Index: /code/branches/buildsystem3/src/CMakeLists.txt
===================================================================
--- /code/branches/buildsystem3/src/CMakeLists.txt	(revision 2689)
+++ /code/branches/buildsystem3/src/CMakeLists.txt	(revision 2690)
@@ -69,5 +69,5 @@
 # which one we have to define the macros separately for each configuration
 ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Debug"          Debug)
-ADD_COMPILER_FLAGS("-DCMAKE_BIULD_TYPE=Release"        Release)
+ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Release"        Release)
 ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=RelWithDebInfo" RelWithDebInfo)
 ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=MinSizeRel"     MinSizeRel)
Index: /code/branches/buildsystem3/src/core/CMakeLists.txt
===================================================================
--- /code/branches/buildsystem3/src/core/CMakeLists.txt	(revision 2689)
+++ /code/branches/buildsystem3/src/core/CMakeLists.txt	(revision 2690)
@@ -68,16 +68,4 @@
 GENERATE_TOLUA_BINDINGS(Core CORE_FILES INPUTFILES LuaBind.h CommandExecutor.h)
 
-IF(GCC_NO_SYSTEM_HEADER_SUPPORT)
-  # Get around displaying a few hundred lines of warning code
-  SET_SOURCE_FILES_PROPERTIES(
-    ArgumentCompletionFunctions.cc
-    CommandLine.cc
-    ConfigFileManager.cc
-    Language.cc
-    LuaBind.cc
-    input/KeyBinder.cc
-    PROPERTIES COMPILE_FLAGS "-Wno-sign-compare")
-ENDIF()
-
 ADD_LIBRARY(core SHARED ${CORE_FILES})
 
Index: /code/branches/buildsystem3/src/core/ConfigFileManager.cc
===================================================================
--- /code/branches/buildsystem3/src/core/ConfigFileManager.cc	(revision 2689)
+++ /code/branches/buildsystem3/src/core/ConfigFileManager.cc	(revision 2690)
@@ -223,124 +223,128 @@
     void ConfigFile::load(bool bCreateIfNotExisting)
     {
-        // Be sure we start from new
+        // Be sure we start from new in the memory
         this->clear();
 
-        boost::filesystem::path filepath(Core::getConfigPath() + "/" + this->filename_);
-
-        // This creates the config file if it's not existing
-        std::ofstream createFile;
-        createFile.open(filepath.file_string().c_str(), std::fstream::app);
-        createFile.close();
+        // Get default file if necessary and available
+        boost::filesystem::path filepath(Core::getConfigPath());
+        filepath /= this->filename_;
+        if (!boost::filesystem::exists(filepath))
+        {
+            // Try to get default one from the media folder
+            boost::filesystem::path defaultFilepath(Core::getMediaPath());
+            defaultFilepath = defaultFilepath / "defaultConfig" / this->filename_;
+            if (boost::filesystem::exists(defaultFilepath))
+            {
+                boost::filesystem::copy_file(defaultFilepath, filepath);
+            }
+        }
 
         // Open the file
         std::ifstream file;
         file.open(filepath.file_string().c_str(), std::fstream::in);
-
-        if (!file.is_open())
-        {
-            COUT(1) << "An error occurred in ConfigFileManager.cc:" << std::endl;
-            COUT(1) << "Error: Couldn't open config-file \"" << this->filename_ << "\"." << std::endl;
-            return;
-        }
-
-        char linearray[CONFIG_FILE_MAX_LINELENGHT];
-
-        ConfigFileSection* newsection = 0;
-
-        while (file.good() && !file.eof())
-        {
-            file.getline(linearray, CONFIG_FILE_MAX_LINELENGHT);
-
-            std::string line = std::string(linearray);
-
-            std::string temp = getStripped(line);
-            if (!isEmpty(temp) && !isComment(temp))
-            {
-                size_t   pos1 = temp.find('[');
-                if (pos1 == 0) pos1 = line.find('['); else pos1 = std::string::npos;
-                size_t   pos2 = line.find(']');
-
-                if (pos1 != std::string::npos && pos2 != std::string::npos && pos2 > pos1 + 1)
+        if (file.is_open())
+        {
+
+            char linearray[CONFIG_FILE_MAX_LINELENGHT];
+
+            ConfigFileSection* newsection = 0;
+
+            while (file.good() && !file.eof())
+            {
+                file.getline(linearray, CONFIG_FILE_MAX_LINELENGHT);
+
+                std::string line = std::string(linearray);
+
+                std::string temp = getStripped(line);
+                if (!isEmpty(temp) && !isComment(temp))
                 {
-                    // New section
-                    std::string comment = line.substr(pos2 + 1);
-                    if (isComment(comment))
-                        newsection = new ConfigFileSection(line.substr(pos1 + 1, pos2 - pos1 - 1), comment);
-                    else
-                        newsection = new ConfigFileSection(line.substr(pos1 + 1, pos2 - pos1 - 1));
-                    this->sections_.insert(this->sections_.end(), newsection);
-                    continue;
-                }
-            }
-
-            if (newsection != 0)
-            {
-                if (isComment(line))
-                {
-                    // New comment
-                    newsection->getEntries().insert(newsection->getEntries().end(), new ConfigFileEntryComment(removeTrailingWhitespaces(line)));
-                    continue;
-                }
-                else
-                {
-                    size_t pos1 = line.find('=');
-
-                    if (pos1 != std::string::npos && pos1 > 0)
+                    size_t   pos1 = temp.find('[');
+                    if (pos1 == 0) pos1 = line.find('['); else pos1 = std::string::npos;
+                    size_t   pos2 = line.find(']');
+
+                    if (pos1 != std::string::npos && pos2 != std::string::npos && pos2 > pos1 + 1)
                     {
-                        // New entry
-                        size_t pos2 = line.find('[');
-                        size_t pos3 = line.find(']');
-                        size_t commentposition = getNextCommentPosition(line, pos1 + 1);
-                        while (isBetweenQuotes(line, commentposition))
-                        {
-                            commentposition = getNextCommentPosition(line, commentposition + 1);
-                        }
-                        std::string value = "", comment = "";
-                        if (commentposition == std::string::npos)
-                        {
-                            value = removeTrailingWhitespaces(line.substr(pos1 + 1));
-                        }
+                        // New section
+                        std::string comment = line.substr(pos2 + 1);
+                        if (isComment(comment))
+                            newsection = new ConfigFileSection(line.substr(pos1 + 1, pos2 - pos1 - 1), comment);
                         else
-                        {
-                            value = removeTrailingWhitespaces(line.substr(pos1 + 1, commentposition - pos1 - 1));
-                            comment = removeTrailingWhitespaces(line.substr(commentposition));
-                        }
-
-                        if (pos2 != std::string::npos && pos3 != std::string::npos && pos3 > pos2 + 1)
-                        {
-                            // There might be an array index
-                            unsigned int index = 0;
-                            if (ConvertValue(&index, line.substr(pos2 + 1, pos3 - pos2 - 1)))
-                            {
-                                // New array
-                                std::list<ConfigFileEntry*>::iterator it = newsection->getEntryIterator(getStripped(line.substr(0, pos2)), index, value, false);
-                                (*it)->setValue(value);
-                                (*it)->setComment(comment);
-                                continue;
-                            }
-                        }
-
-                        // New value
-                        newsection->getEntries().insert(newsection->getEntries().end(), new ConfigFileEntryValue(getStripped(line.substr(0, pos1)), value, false, comment));
+                            newsection = new ConfigFileSection(line.substr(pos1 + 1, pos2 - pos1 - 1));
+                        this->sections_.insert(this->sections_.end(), newsection);
                         continue;
                     }
                 }
-            }
-        }
-
-        file.close();
-
-        COUT(3) << "Loaded config file \"" << this->filename_ << "\"." << std::endl;
-
-        // Save the file in case something changed (like stripped whitespaces)
-        this->save();
-
-        // Update all ConfigValueContainers
-        this->updateConfigValues();
+
+                if (newsection != 0)
+                {
+                    if (isComment(line))
+                    {
+                        // New comment
+                        newsection->getEntries().insert(newsection->getEntries().end(), new ConfigFileEntryComment(removeTrailingWhitespaces(line)));
+                        continue;
+                    }
+                    else
+                    {
+                        size_t pos1 = line.find('=');
+
+                        if (pos1 != std::string::npos && pos1 > 0)
+                        {
+                            // New entry
+                            size_t pos2 = line.find('[');
+                            size_t pos3 = line.find(']');
+                            size_t commentposition = getNextCommentPosition(line, pos1 + 1);
+                            while (isBetweenQuotes(line, commentposition))
+                            {
+                                commentposition = getNextCommentPosition(line, commentposition + 1);
+                            }
+                            std::string value = "", comment = "";
+                            if (commentposition == std::string::npos)
+                            {
+                                value = removeTrailingWhitespaces(line.substr(pos1 + 1));
+                            }
+                            else
+                            {
+                                value = removeTrailingWhitespaces(line.substr(pos1 + 1, commentposition - pos1 - 1));
+                                comment = removeTrailingWhitespaces(line.substr(commentposition));
+                            }
+
+                            if (pos2 != std::string::npos && pos3 != std::string::npos && pos3 > pos2 + 1)
+                            {
+                                // There might be an array index
+                                unsigned int index = 0;
+                                if (ConvertValue(&index, line.substr(pos2 + 1, pos3 - pos2 - 1)))
+                                {
+                                    // New array
+                                    std::list<ConfigFileEntry*>::iterator it = newsection->getEntryIterator(getStripped(line.substr(0, pos2)), index, value, false);
+                                    (*it)->setValue(value);
+                                    (*it)->setComment(comment);
+                                    continue;
+                                }
+                            }
+
+                            // New value
+                            newsection->getEntries().insert(newsection->getEntries().end(), new ConfigFileEntryValue(getStripped(line.substr(0, pos1)), value, false, comment));
+                            continue;
+                        }
+                    }
+                }
+            }
+
+            file.close();
+
+            COUT(3) << "Loaded config file \"" << this->filename_ << "\"." << std::endl;
+
+            // Save the file in case something changed (like stripped whitespaces)
+            this->save();
+
+            // Update all ConfigValueContainers
+            this->updateConfigValues();
+        } // end file.is_open()
     }
 
     void ConfigFile::save() const
     {
-        boost::filesystem::path filepath(Core::getConfigPath() + "/" + this->filename_);
+        boost::filesystem::path filepath(Core::getConfigPath());
+        filepath /= this->filename_;
 
         std::ofstream file;
Index: /code/branches/buildsystem3/src/core/Core.cc
===================================================================
--- /code/branches/buildsystem3/src/core/Core.cc	(revision 2689)
+++ /code/branches/buildsystem3/src/core/Core.cc	(revision 2690)
@@ -34,4 +34,8 @@
 #include "Core.h"
 #include <cassert>
+#include <fstream>
+#include <boost/filesystem.hpp>
+
+#include "util/Exception.h"
 #include "Language.h"
 #include "CoreIncludes.h"
@@ -51,4 +55,5 @@
     std::string Core::configPath_s(ORXONOX_CONFIG_INSTALL_PATH); // from OrxonoxConfig.h
     std::string Core::logPath_s   (ORXONOX_LOG_INSTALL_PATH);    // from OrxonoxConfig.h
+    std::string Core::mediaPath_s (ORXONOX_MEDIA_INSTALL_PATH);  // from OrxonoxConfig.h
 
     Core* Core::singletonRef_s = 0;
@@ -119,5 +124,5 @@
             defaultMediaPath = ORXONOX_MEDIA_DEV_PATH;
 
-        SetConfigValue(mediaPath_, defaultMediaPath)
+        SetConfigValue(mediaPath_s, defaultMediaPath)
             .description("Relative path to the game data.").callback(this, &Core::mediaPathChanged);
 
@@ -157,12 +162,12 @@
     void Core::mediaPathChanged()
     {
-        if (mediaPath_ != "" && mediaPath_[mediaPath_.size() - 1] != '/')
-        {
-            ModifyConfigValue(mediaPath_, set, mediaPath_ + "/");
-        }
-
-        if (mediaPath_ == "")
-        {
-            ModifyConfigValue(mediaPath_, set, "/");
+        if (mediaPath_s != "" && mediaPath_s[mediaPath_s.size() - 1] != '/')
+        {
+            ModifyConfigValue(mediaPath_s, set, mediaPath_s + "/");
+        }
+
+        if (mediaPath_s == "")
+        {
+            ModifyConfigValue(mediaPath_s, set, "/");
             COUT(2) << "Warning: Data path set to \"/\", is that really correct?" << std::endl;
         }
@@ -245,9 +250,9 @@
         if (*path.end() != '/' && *path.end() != '\\')
         {
-            ModifyConfigValue(mediaPath_, tset, path + "/");
+            ModifyConfigValue(mediaPath_s, tset, path + "/");
         }
         else
         {
-            ModifyConfigValue(mediaPath_, tset, path);
+            ModifyConfigValue(mediaPath_s, tset, path);
         }
     }
@@ -264,12 +269,51 @@
     }
 
-    /*static*/ void Core::setDevBuild()
-    {
-        // Be careful never to call this function before main()!
-
-        Core::isDevBuild_s = true;
-        // Constants taken from OrxonoxConfig.h
-        Core::configPath_s = ORXONOX_CONFIG_DEV_PATH;
-        Core::logPath_s    = ORXONOX_LOG_DEV_PATH;
+    /**
+    @brief
+        Checks for "orxonox_dev_build.keep_me" in the working diretory.
+        If found it means that this is not an installed run, hence we
+        don't write the logs and config files to ~/.orxonox
+    */
+    /*static*/ void Core::checkDevBuild()
+    {
+        std::ifstream probe;
+        probe.open("orxonox_dev_build.keep_me");
+        if (probe)
+        {
+            Core::isDevBuild_s = true;
+            // Constants are taken from OrxonoxConfig.h
+            Core::configPath_s = ORXONOX_CONFIG_DEV_PATH;
+            Core::logPath_s    = ORXONOX_LOG_DEV_PATH;
+            Core::mediaPath_s  = ORXONOX_MEDIA_DEV_PATH;
+            probe.close();
+        }
+    }
+
+    /*
+    @brief
+        Checks for the log and the config directory and creates them
+        if necessary. Otherwise me might have problems opening those files.
+    */
+    /*static*/ void Core::createDirectories()
+    {
+        std::vector<std::pair<boost::filesystem::path, std::string> > directories;
+        directories.push_back(std::pair<boost::filesystem::path, std::string>
+            (boost::filesystem::path(Core::configPath_s), "config"));
+        directories.push_back(std::pair<boost::filesystem::path, std::string>
+            (boost::filesystem::path(Core::logPath_s),    "log"));
+
+        for (std::vector<std::pair<boost::filesystem::path, std::string> >::iterator it = directories.begin();
+            it != directories.end(); ++it)
+        {
+            if (boost::filesystem::exists(it->first) && !boost::filesystem::is_directory(it->first))
+            {
+                ThrowException(General, std::string("The ") + it->second + " directory has been preoccupied by a file! \
+                                         Please remove " + it->first.file_string());
+            }
+            if (boost::filesystem::create_directory(it->first)) // function may not return true at all (bug?)
+            {
+                COUT(4) << "Created " << it->second << " directory" << std::endl;
+            }
+        }
     }
 }
Index: /code/branches/buildsystem3/src/core/Core.h
===================================================================
--- /code/branches/buildsystem3/src/core/Core.h	(revision 2689)
+++ /code/branches/buildsystem3/src/core/Core.h	(revision 2690)
@@ -68,8 +68,7 @@
             static bool isDevBuild() { return Core::isDevBuild_s; }
 
-            static const std::string& getMediaPath()
-            { assert(singletonRef_s); return singletonRef_s->mediaPath_; }
             static void tsetMediaPath(const std::string& path)
             { assert(singletonRef_s); singletonRef_s->_tsetMediaPath(path); }
+            static const std::string& getMediaPath()  { return mediaPath_s; }
             static const std::string& getConfigPath() { return configPath_s; }
             static const std::string& getLogPath()    { return logPath_s; }
@@ -96,5 +95,6 @@
             void _tsetMediaPath(const std::string& path);
 
-            static void setDevBuild();
+            static void createDirectories();
+            static void checkDevBuild();
 
             int softDebugLevel_;                            //!< The debug level
@@ -104,5 +104,4 @@
             std::string language_;                          //!< The language
             bool bInitializeRandomNumberGenerator_;         //!< If true, srand(time(0)) is called
-            std::string mediaPath_;                         //!< Path to the data/media file folder
 
             static bool bShowsGraphics_s;                   //!< global variable that tells whether to show graphics
@@ -115,4 +114,5 @@
             static std::string configPath_s;                //!< Path to the config file folder
             static std::string logPath_s;                   //!< Path to the log file folder
+            static std::string mediaPath_s;                 //!< Path to the data/media file folder
 
             static Core* singletonRef_s;
Index: /code/branches/buildsystem3/src/core/input/KeyBinder.cc
===================================================================
--- /code/branches/buildsystem3/src/core/input/KeyBinder.cc	(revision 2689)
+++ /code/branches/buildsystem3/src/core/input/KeyBinder.cc	(revision 2690)
@@ -248,5 +248,5 @@
         True if loading succeeded.
     */
-    void KeyBinder::loadBindings(const std::string& filename, const std::string& defaultFilename)
+    void KeyBinder::loadBindings(const std::string& filename)
     {
         COUT(3) << "KeyBinder: Loading key bindings..." << std::endl;
@@ -255,17 +255,4 @@
             return;
 
-        boost::filesystem::path folder(Core::getConfigPath());
-        boost::filesystem::path filepath(folder/filename);
-
-        // get bindings from default file if filename doesn't exist.
-        std::ifstream infile;
-        infile.open(filepath.file_string().c_str());
-        if (!infile)
-        {
-            ConfigFileManager::getInstance().setFilename(this->configFile_, defaultFilename);
-            ConfigFileManager::getInstance().saveAs(this->configFile_, filename);
-        }
-        else
-            infile.close();
         ConfigFileManager::getInstance().setFilename(this->configFile_, filename);
 
Index: /code/branches/buildsystem3/src/core/input/KeyBinder.h
===================================================================
--- /code/branches/buildsystem3/src/core/input/KeyBinder.h	(revision 2689)
+++ /code/branches/buildsystem3/src/core/input/KeyBinder.h	(revision 2690)
@@ -61,5 +61,5 @@
         virtual ~KeyBinder();
 
-        void loadBindings(const std::string& filename, const std::string& defaultFilename);
+        void loadBindings(const std::string& filename);
         void clearBindings();
         bool setBinding(const std::string& binding, const std::string& name, bool bTemporary = false);
Index: /code/branches/buildsystem3/src/orxonox/CMakeLists.txt
===================================================================
--- /code/branches/buildsystem3/src/orxonox/CMakeLists.txt	(revision 2689)
+++ /code/branches/buildsystem3/src/orxonox/CMakeLists.txt	(revision 2690)
@@ -39,13 +39,4 @@
 # Not using precompiled header files: Avoid dependencies
 INCLUDE_DIRECTORIES(pch/nopch)
-
-IF(GCC_NO_SYSTEM_HEADER_SUPPORT)
-  # Get around displaying a few hundred lines of warning code
-  SET_SOURCE_FILES_PROPERTIES(
-    gamestates/GSGraphics.cc
-    gui/GUIManager.cc
-    PROPERTIES COMPILE_FLAGS "-Wno-sign-compare"
-  )
-ENDIF()
 
 ADD_EXECUTABLE(orxonox ${ORXONOX_FILES})
Index: /code/branches/buildsystem3/src/orxonox/Main.cc
===================================================================
--- /code/branches/buildsystem3/src/orxonox/Main.cc	(revision 2689)
+++ /code/branches/buildsystem3/src/orxonox/Main.cc	(revision 2690)
@@ -37,5 +37,4 @@
 #include <exception>
 #include <cassert>
-#include <fstream>
 
 #include "OrxonoxConfig.h"
@@ -95,11 +94,8 @@
     // First, determine whether we have an installed or a binary dir run
     // The latter occurs when simply running from the build directory
-    std::ifstream probe;
-    probe.open("orxonox_dev_build.keep_me");
-    if (probe)
-    {
-        Core::setDevBuild();
-        probe.close();
-    }
+    Core::checkDevBuild();
+
+    // Make sure the directories we write in exist or else make them
+    Core::createDirectories();
 
     // create a signal handler (only active for linux)
Index: /code/branches/buildsystem3/src/orxonox/gamestates/GSGraphics.cc
===================================================================
--- /code/branches/buildsystem3/src/orxonox/gamestates/GSGraphics.cc	(revision 2689)
+++ /code/branches/buildsystem3/src/orxonox/gamestates/GSGraphics.cc	(revision 2690)
@@ -107,6 +107,4 @@
         SetConfigValue(ogreLogLevelCritical_, 2)
             .description("Corresponding orxonox debug level for ogre Critical");
-        SetConfigValue(defaultMasterKeybindings_, "def_masterKeybindings.ini")
-            .description("Filename of default master keybindings.");
     }
 
@@ -148,5 +146,5 @@
         // Configure master input state with a KeyBinder
         masterKeyBinder_ = new KeyBinder();
-        masterKeyBinder_->loadBindings("masterKeybindings.ini", defaultMasterKeybindings_);
+        masterKeyBinder_->loadBindings("masterKeybindings.ini");
         inputManager_->getMasterInputState()->addKeyHandler(masterKeyBinder_);
 
Index: /code/branches/buildsystem3/src/orxonox/gamestates/GSGraphics.h
===================================================================
--- /code/branches/buildsystem3/src/orxonox/gamestates/GSGraphics.h	(revision 2689)
+++ /code/branches/buildsystem3/src/orxonox/gamestates/GSGraphics.h	(revision 2690)
@@ -105,5 +105,4 @@
         int                   ogreLogLevelNormal_;       //!< Corresponding Orxonx debug level for LL_NORMAL
         int                   ogreLogLevelCritical_;     //!< Corresponding Orxonx debug level for LL_CRITICAL
-        std::string           defaultMasterKeybindings_; //!< Filename of default master keybindings.
 
         // console commands
Index: /code/branches/buildsystem3/src/orxonox/gamestates/GSLevel.cc
===================================================================
--- /code/branches/buildsystem3/src/orxonox/gamestates/GSLevel.cc	(revision 2689)
+++ /code/branches/buildsystem3/src/orxonox/gamestates/GSLevel.cc	(revision 2690)
@@ -75,6 +75,4 @@
     {
         SetConfigValue(keyDetectorCallbackCode_, "KeybindBindingStringKeyName=");
-        SetConfigValue(defaultKeybindings_, "def_keybindings.ini")
-            .description("Filename of default keybindings.");
     }
 
@@ -85,5 +83,5 @@
             inputState_ = InputManager::getInstance().createInputState<SimpleInputState>("game", 20);
             keyBinder_ = new KeyBinder();
-            keyBinder_->loadBindings("keybindings.ini", defaultKeybindings_);
+            keyBinder_->loadBindings("keybindings.ini");
             inputState_->setHandler(keyBinder_);
 
Index: /code/branches/buildsystem3/src/orxonox/gamestates/GSLevel.h
===================================================================
--- /code/branches/buildsystem3/src/orxonox/gamestates/GSLevel.h	(revision 2689)
+++ /code/branches/buildsystem3/src/orxonox/gamestates/GSLevel.h	(revision 2690)
@@ -66,6 +66,4 @@
         //##### ConfigValues #####
         std::string           keyDetectorCallbackCode_;
-        //! Filename of default keybindings.
-        std::string           defaultKeybindings_;
 
         // console commands
