diff --git a/src/conf-file-processor.cpp b/src/conf-file-processor.cpp
index bbca665..dc422f5 100644
--- a/src/conf-file-processor.cpp
+++ b/src/conf-file-processor.cpp
@@ -39,7 +39,6 @@
 {
 public:
   typedef std::function<void(T)> ConfParameterCallback;
-  typedef boost::property_tree::ptree ConfigSection;
 
   ConfigurationVariable(const std::string& key, const ConfParameterCallback& setter)
     : m_key(key)
@@ -160,7 +159,6 @@
 ConfFileProcessor::load(std::istream& input)
 {
   ConfigSection pt;
-  bool ret = true;
   try {
     boost::property_tree::read_info(input, pt);
   }
@@ -171,14 +169,12 @@
     return false;
   }
 
-  for (ConfigSection::const_iterator tn = pt.begin();
-       tn != pt.end(); ++tn) {
-    ret = processSection(tn->first, tn->second);
-    if (ret == false) {
-      break;
+  for (const auto& tn : pt) {
+    if (!processSection(tn.first, tn.second)) {
+      return false;
     }
   }
-  return ret;
+  return true;
 }
 
 bool
@@ -323,19 +319,31 @@
 
   try {
     std::string stateDir = section.get<std::string>("state-dir");
-    if (boost::filesystem::exists(stateDir)) {
-      if (boost::filesystem::is_directory(stateDir)) {
+    if (bf::exists(stateDir)) {
+      if (bf::is_directory(stateDir)) {
 
         // copying nlsr.conf file to a user define directory for possible modification
-        std::string conFileDynamic = (boost::filesystem::path(stateDir) / "nlsr.conf").c_str();
+        std::string conFileDynamic = (bf::path(stateDir) / "nlsr.conf").c_str();
+
+        if (m_confFileName == conFileDynamic) {
+          std::cerr << "Please use nlsr.conf stored at another location "
+                    << "or change the state-dir in the configuration." << std::endl;
+          std::cerr << "The file at " << conFileDynamic <<
+                       " is used as dynamic file for saving NLSR runtime changes." << std::endl;
+          std::cerr << "The dynamic file can be used for next run "
+                    << "after copying to another location." << std::endl;
+          return false;
+        }
+
         m_confParam.setConfFileNameDynamic(conFileDynamic);
         try {
-          copy_file(m_confFileName, conFileDynamic, boost::filesystem::copy_option::overwrite_if_exists);
+          bf::copy_file(m_confFileName, conFileDynamic, bf::copy_option::overwrite_if_exists);
         }
-        catch (const boost::filesystem::filesystem_error& e) {
+        catch (const bf::filesystem_error& e) {
           std::cerr << "Error copying conf file to the state directory: " << e.what() << std::endl;
         }
-        std::string testFileName = (boost::filesystem::path(stateDir) / "test.seq").c_str();
+
+        std::string testFileName = (bf::path(stateDir) / "test.seq").c_str();
         std::ofstream testOutFile(testFileName);
         if (testOutFile) {
           m_confParam.setStateFileDir(stateDir);
@@ -451,12 +459,10 @@
     return false;
   }
 
-  for (ConfigSection::const_iterator tn =
-           section.begin(); tn != section.end(); ++tn) {
-
-    if (tn->first == "neighbor") {
+  for (const auto& tn : section) {
+    if (tn.first == "neighbor") {
       try {
-        ConfigSection CommandAttriTree = tn->second;
+        ConfigSection CommandAttriTree = tn.second;
         std::string name = CommandAttriTree.get<std::string>("name");
         std::string uriString = CommandAttriTree.get<std::string>("face-uri");
 
@@ -597,12 +603,10 @@
 bool
 ConfFileProcessor::processConfSectionAdvertising(const ConfigSection& section)
 {
-  for (ConfigSection::const_iterator tn =
-         section.begin(); tn != section.end(); ++tn) {
-   if (tn->first == "prefix") {
+  for (const auto& tn : section) {
+   if (tn.first == "prefix") {
      try {
-       std::string prefix = tn->second.data();
-       ndn::Name namePrefix(prefix);
+       ndn::Name namePrefix(tn.second.data());
        if (!namePrefix.empty()) {
          m_confParam.getNamePrefixList().insert(namePrefix);
        }
@@ -638,7 +642,6 @@
 
     it++;
     for (; it != section.end(); it++) {
-      using namespace boost::filesystem;
 
       if (it->first != "cert-to-publish") {
         std::cerr << "Error: Expect cert-to-publish!" << std::endl;
@@ -646,9 +649,8 @@
       }
 
       std::string file = it->second.data();
-      path certfilePath = absolute(file, path(m_confFileName).parent_path());
-      std::shared_ptr<ndn::security::v2::Certificate> idCert =
-        ndn::io::load<ndn::security::v2::Certificate>(certfilePath.string());
+      bf::path certfilePath = absolute(file, bf::path(m_confFileName).parent_path());
+      auto idCert = ndn::io::load<ndn::security::v2::Certificate>(certfilePath.string());
 
       if (idCert == nullptr) {
         std::cerr << "Error: Cannot load cert-to-publish: " << file << "!" << std::endl;
diff --git a/src/conf-file-processor.hpp b/src/conf-file-processor.hpp
index 65b9a16..e33b50b 100644
--- a/src/conf-file-processor.hpp
+++ b/src/conf-file-processor.hpp
@@ -30,6 +30,9 @@
 
 namespace nlsr {
 
+namespace bf = boost::filesystem;
+using ConfigSection = boost::property_tree::ptree;
+
 /*! \brief A class containing methods to parse an NLSR configuration file
  *
  * This class contains methods to parse an NLSR configuration file and
@@ -59,8 +62,6 @@
   processConfFile();
 
 private:
-  typedef boost::property_tree::ptree ConfigSection;
-
   /*! \brief Parse the configuration file into a tree and process the nodes.
    *
    * Reads the configuration file as a property tree, and then iterates
diff --git a/src/conf-parameter.hpp b/src/conf-parameter.hpp
index df541a5..7848676 100644
--- a/src/conf-parameter.hpp
+++ b/src/conf-parameter.hpp
@@ -466,8 +466,10 @@
   void
   writeLog();
 
-private:
+PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   std::string m_confFileName;
+  std::string m_confFileNameDynamic;
+private:
   ndn::Name m_routerName;
   ndn::Name m_siteName;
   ndn::Name m_network;
@@ -506,8 +508,6 @@
 
   int32_t m_syncProtocol;
 
-  std::string m_confFileNameDynamic;
-
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   static const uint64_t SYNC_VERSION;
 
