diff --git a/.jenkins.d/01-dependencies.sh b/.jenkins.d/01-dependencies.sh
index 5c6c0d5..b1ba81f 100755
--- a/.jenkins.d/01-dependencies.sh
+++ b/.jenkins.d/01-dependencies.sh
@@ -10,7 +10,7 @@
     brew update
     brew upgrade
     brew install boost pkg-config sqlite cryptopp log4cxx protobuf openssl
-    brew link --force openssl
+    brew link --force openssl log4cxx protobuf
     brew cleanup
 fi
 
diff --git a/src/communication/sync-logic-handler.cpp b/src/communication/sync-logic-handler.cpp
index 1434aa4..d99b3e1 100644
--- a/src/communication/sync-logic-handler.cpp
+++ b/src/communication/sync-logic-handler.cpp
@@ -201,8 +201,7 @@
 
     update.getSequencingManager().writeLog();
 
-    try {
-      if (isLsaNew(originRouter, NameLsa::TYPE_STRING, update.getNameLsaSeqNo())) {
+    if (isLsaNew(originRouter, NameLsa::TYPE_STRING, update.getNameLsaSeqNo())) {
         _LOG_DEBUG("Received sync update with higher Name LSA sequence number than entry in LSDB");
 
         expressInterestForLsa(update, NameLsa::TYPE_STRING, update.getNameLsaSeqNo());
@@ -210,20 +209,29 @@
 
       if (isLsaNew(originRouter, AdjLsa::TYPE_STRING, update.getAdjLsaSeqNo())) {
         _LOG_DEBUG("Received sync update with higher Adj LSA sequence number than entry in LSDB");
-
-        expressInterestForLsa(update, AdjLsa::TYPE_STRING, update.getAdjLsaSeqNo());
+        if (m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_ON) {
+          if (update.getAdjLsaSeqNo() != 0) {
+            _LOG_ERROR("Tried to fetch an adjacency LSA when hyperbolic routing"
+                       << " is enabled.");
+          }
+        }
+        else {
+          expressInterestForLsa(update, AdjLsa::TYPE_STRING, update.getAdjLsaSeqNo());
+        }
       }
 
       if (isLsaNew(originRouter, CoordinateLsa::TYPE_STRING, update.getCorLsaSeqNo())) {
         _LOG_DEBUG("Received sync update with higher Cor LSA sequence number than entry in LSDB");
-
-        expressInterestForLsa(update, CoordinateLsa::TYPE_STRING, update.getCorLsaSeqNo());
+        if (m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_OFF) {
+          if (update.getCorLsaSeqNo() != 0) {
+            _LOG_ERROR("Tried to fetch a coordinate LSA when link-state"
+                       << " is enabled.");
+          }
+        }
+        else {
+          expressInterestForLsa(update, CoordinateLsa::TYPE_STRING, update.getCorLsaSeqNo());
+        }
       }
-    }
-    catch (std::exception& e) {
-      std::cerr << e.what() << std::endl;
-      return;
-    }
   }
 }
 
diff --git a/src/conf-parameter.hpp b/src/conf-parameter.hpp
index 72949c7..d6833ed 100644
--- a/src/conf-parameter.hpp
+++ b/src/conf-parameter.hpp
@@ -86,7 +86,7 @@
   MAX_FACES_PER_PREFIX_MAX = 60
 };
 
-enum {
+enum HyperbolicState {
   HYPERBOLIC_STATE_OFF = 0,
   HYPERBOLIC_STATE_ON = 1,
   HYPERBOLIC_STATE_DRY_RUN = 2,
diff --git a/src/lsdb.cpp b/src/lsdb.cpp
index 8d7f1ec..5b1fda6 100644
--- a/src/lsdb.cpp
+++ b/src/lsdb.cpp
@@ -359,8 +359,15 @@
                        getLsaExpirationTimePoint(),
                        m_nlsr.getConfParameter().getCorR(),
                        m_nlsr.getConfParameter().getCorTheta());
-  m_nlsr.getSequencingManager().increaseCorLsaSeq();
+
+  // Sync coordinate LSAs if using HR or HR dry run.
+  if (m_nlsr.getConfParameter().getHyperbolicState() != HYPERBOLIC_STATE_OFF) {
+    m_nlsr.getSequencingManager().increaseCorLsaSeq();
+    m_sync.publishRoutingUpdate();
+  }
+
   installCoordinateLsa(corLsa);
+
   return true;
 }
 
@@ -411,11 +418,12 @@
     clsa.writeLog();
     addCoordinateLsa(clsa);
 
+    // Register the LSA's origin router prefix
     if (clsa.getOrigRouter() != m_nlsr.getConfParameter().getRouterPrefix()) {
       m_nlsr.getNamePrefixTable().addEntry(clsa.getOrigRouter(),
                                            clsa.getOrigRouter());
     }
-    if (m_nlsr.getConfParameter().getHyperbolicState() >= HYPERBOLIC_STATE_ON) {
+    if (m_nlsr.getConfParameter().getHyperbolicState() != HYPERBOLIC_STATE_OFF) {
       m_nlsr.getRoutingTable().scheduleRoutingTableCalculation(m_nlsr);
     }
     if (clsa.getOrigRouter() != m_nlsr.getConfParameter().getRouterPrefix()) {
@@ -479,12 +487,12 @@
                                                                  _1, key));
   if (it != m_corLsdb.end()) {
     _LOG_DEBUG("Deleting Coordinate Lsa");
-    (*it).writeLog();
-    if ((*it).getOrigRouter() !=
-        m_nlsr.getConfParameter().getRouterPrefix()) {
-      m_nlsr.getNamePrefixTable().removeEntry((*it).getOrigRouter(),
-                                              (*it).getOrigRouter());
+    it->writeLog();
+
+    if (it->getOrigRouter() != m_nlsr.getConfParameter().getRouterPrefix()) {
+      m_nlsr.getNamePrefixTable().removeEntry(it->getOrigRouter(), it->getOrigRouter());
     }
+
     m_corLsdb.erase(it);
     return true;
   }
@@ -533,6 +541,11 @@
 {
   m_nlsr.incrementAdjBuildCount();
 
+  if (m_nlsr.getConfParameter().getHyperbolicState() == HYPERBOLIC_STATE_ON) {
+    // Don't build adjacency LSAs in hyperbolic routing
+    return;
+  }
+
   if (m_nlsr.getIsBuildAdjLsaSheduled() == false) {
     _LOG_DEBUG("Scheduling Adjacency LSA build in " << m_adjLsaBuildInterval);
 
@@ -681,9 +694,11 @@
                 m_nlsr.getAdjacencyList().getNumOfActiveNeighbor(),
                 m_nlsr.getAdjacencyList());
 
-  m_nlsr.getSequencingManager().increaseAdjLsaSeq();
-
-  m_sync.publishRoutingUpdate();
+  //Sync adjacency LSAs if link-state or dry-run HR is enabled.
+  if (m_nlsr.getConfParameter().getHyperbolicState() != HYPERBOLIC_STATE_ON) {
+    m_nlsr.getSequencingManager().increaseAdjLsaSeq();
+    m_sync.publishRoutingUpdate();
+  }
 
   return installAdjLsa(adjLsa);
 }
@@ -815,7 +830,10 @@
         _LOG_DEBUG("Deleting Coordinate Lsa");
         chkCorLsa->writeLog();
         chkCorLsa->setLsSeqNo(chkCorLsa->getLsSeqNo() + 1);
-        m_nlsr.getSequencingManager().setCorLsaSeq(chkCorLsa->getLsSeqNo());
+        if (m_nlsr.getConfParameter().getHyperbolicState() != HYPERBOLIC_STATE_OFF) {
+          m_nlsr.getSequencingManager().setCorLsaSeq(chkCorLsa->getLsSeqNo());
+        }
+
         chkCorLsa->setExpirationTimePoint(getLsaExpirationTimePoint());
         _LOG_DEBUG("Adding Coordinate Lsa");
         chkCorLsa->writeLog();
@@ -824,13 +842,16 @@
                                         chkCorLsa->getKey(),
                                         chkCorLsa->getLsSeqNo(),
                                         m_lsaRefreshTime));
-        m_sync.publishRoutingUpdate();
+        // Only sync coordinate LSAs if link-state routing is disabled
+        if (m_nlsr.getConfParameter().getHyperbolicState() != HYPERBOLIC_STATE_OFF) {
+          m_sync.publishRoutingUpdate();
+        }
       }
       else {
         _LOG_DEBUG("Other's Cor LSA, so removing form LSDB");
         removeCoordinateLsa(lsaKey);
       }
-      if (m_nlsr.getConfParameter().getHyperbolicState() >= HYPERBOLIC_STATE_ON) {
+      if (m_nlsr.getConfParameter().getHyperbolicState() == HYPERBOLIC_STATE_ON) {
         m_nlsr.getRoutingTable().scheduleRoutingTableCalculation(m_nlsr);
       }
     }
@@ -934,6 +955,10 @@
                                      const ndn::Name& lsaKey,
                                      uint64_t seqNo)
 {
+  if (m_nlsr.getConfParameter().getHyperbolicState() == HYPERBOLIC_STATE_ON) {
+    _LOG_ERROR("Received interest for an adjacency LSA when hyperbolic routing is enabled.");
+  }
+
   AdjLsa* adjLsa = m_nlsr.getLsdb().findAdjLsa(lsaKey);
   if (adjLsa != 0) {
     if (adjLsa->getLsSeqNo() == seqNo) {
@@ -948,6 +973,10 @@
                                       const ndn::Name& lsaKey,
                                       uint64_t seqNo)
 {
+  if (m_nlsr.getConfParameter().getHyperbolicState() == HYPERBOLIC_STATE_OFF) {
+    _LOG_ERROR("Received Interest for a coordinate LSA when link-state routing is enabled.");
+  }
+
   CoordinateLsa* corLsa = m_nlsr.getLsdb().findCoordinateLsa(lsaKey);
   if (corLsa != 0) {
     if (corLsa->getLsSeqNo() == seqNo) {
diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index a6039e4..6753a13 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -183,7 +183,7 @@
   m_nlsrLsdb.setThisRouterPrefix(m_confParam.getRouterPrefix().toUri());
   m_fib.setEntryRefreshTime(2 * m_confParam.getLsaRefreshTime());
   m_sequencingManager.setSeqFileName(m_confParam.getSeqFileDir());
-  m_sequencingManager.initiateSeqNoFromFile();
+  m_sequencingManager.initiateSeqNoFromFile(m_confParam.getHyperbolicState());
 
   m_syncLogicHandler.createSyncSocket(m_confParam.getChronosyncPrefix());
 
@@ -204,7 +204,11 @@
   m_routingTable.setRoutingCalcInterval(m_confParam.getRoutingCalcInterval());
 
   m_nlsrLsdb.buildAndInstallOwnNameLsa();
-  m_nlsrLsdb.buildAndInstallOwnCoordinateLsa();
+
+  // Install coordinate LSAs if using HR or dry-run HR.
+  if (m_confParam.getHyperbolicState() != HYPERBOLIC_STATE_OFF) {
+    m_nlsrLsdb.buildAndInstallOwnCoordinateLsa();
+  }
 
   registerKeyPrefix();
   registerLocalhostPrefix();
diff --git a/src/sequencing-manager.cpp b/src/sequencing-manager.cpp
index 7749ae0..2bffc28 100644
--- a/src/sequencing-manager.cpp
+++ b/src/sequencing-manager.cpp
@@ -62,15 +62,34 @@
 }
 
 void
-SequencingManager::initiateSeqNoFromFile()
+SequencingManager::initiateSeqNoFromFile(int hypState)
 {
   _LOG_DEBUG("Seq File Name: " << m_seqFileNameWithPath);
   std::ifstream inputFile(m_seqFileNameWithPath.c_str(), ios::binary);
   if (inputFile.good()) {
     inputFile >> m_combinedSeqNo;
     splitSequenceNo(m_combinedSeqNo);
-    m_adjLsaSeq += 10;
-    m_corLsaSeq += 10;
+
+    // Increment the adjacency LSA seq. no. if link-state or dry HR is enabled
+    if (hypState != HYPERBOLIC_STATE_ON) {
+      if (m_corLsaSeq != 0) {
+        _LOG_WARN("This router was previously configured for hyperbolic"
+                   << " routing without clearing the seq. no. file.");
+        m_corLsaSeq = 0;
+      }
+      m_adjLsaSeq += 10;
+    }
+
+    // Similarly, increment the coordinate LSA seq. no only if link-state is disabled.
+    if (hypState != HYPERBOLIC_STATE_OFF) {
+      if (m_adjLsaSeq != 0 &&
+          hypState == HYPERBOLIC_STATE_ON) {
+        _LOG_WARN("This router was previously configured for link-state"
+                  << " routing without clearing the seq. no. file.");
+        m_adjLsaSeq = 0;
+      }
+      m_corLsaSeq += 10;
+    }
     m_nameLsaSeq += 10;
     combineSequenceNo();
     inputFile.close();
@@ -111,5 +130,3 @@
 }
 
 }//namespace nlsr
-
-
diff --git a/src/sequencing-manager.hpp b/src/sequencing-manager.hpp
index c023b38..32793d7 100644
--- a/src/sequencing-manager.hpp
+++ b/src/sequencing-manager.hpp
@@ -28,7 +28,10 @@
 
 #include <ndn-cxx/face.hpp>
 
+#include "conf-parameter.hpp"
+
 namespace nlsr {
+
 class SequencingManager
 {
 public:
@@ -124,7 +127,7 @@
   writeSeqNoToFile() const;
 
   void
-  initiateSeqNoFromFile();
+  initiateSeqNoFromFile(int hypState);
 
   void
   setSeqFileName(std::string filePath);
diff --git a/tests/test-sync-logic-handler.cpp b/tests/test-sync-logic-handler.cpp
index c2e092d..0547c6c 100644
--- a/tests/test-sync-logic-handler.cpp
+++ b/tests/test-sync-logic-handler.cpp
@@ -49,7 +49,7 @@
   }
 
   void
-  receiveUpdate(std::string prefix, uint64_t seqNo)
+  receiveUpdate(std::string prefix, uint64_t seqNo, SyncLogicHandler& p_sync)
   {
     Sync::MissingDataInfo info = {prefix, 0, seqNo};
 
@@ -59,7 +59,7 @@
     face->processEvents(ndn::time::milliseconds(1));
     face->sentInterests.clear();
 
-    sync.onNsyncUpdate(updates, NULL);
+    p_sync.onNsyncUpdate(updates, NULL);
 
     face->processEvents(ndn::time::milliseconds(1));
   }
@@ -76,17 +76,86 @@
 
 BOOST_FIXTURE_TEST_SUITE(TestSyncLogicHandler, SyncLogicFixture)
 
-BOOST_AUTO_TEST_CASE(UpdateForOther)
+BOOST_AUTO_TEST_CASE(UpdateForOtherLS)
 {
   std::string updateName = nlsr.getConfParameter().getLsaPrefix().toUri() +
                            CONFIG_SITE + "/%C1.Router/other-router/";
 
-  receiveUpdate(updateName, 1);
+  uint64_t syncSeqNo = 1;
+  receiveUpdate(updateName, syncSeqNo, sync);
 
   std::vector<ndn::Interest>& interests = face->sentInterests;
+  std::vector<ndn::Interest>::iterator it = interests.begin();
+
+  BOOST_REQUIRE_EQUAL(interests.size(), 2);
+
+  BOOST_CHECK_EQUAL(it->getName().getPrefix(-1), updateName + NameLsa::TYPE_STRING + "/");
+
+  ++it;
+  BOOST_CHECK_EQUAL(it->getName().getPrefix(-1), updateName + AdjLsa::TYPE_STRING + "/");
+}
+
+BOOST_AUTO_TEST_CASE(UpdateForOtherHR)
+{
+  Nlsr nlsr_hr(g_ioService, g_scheduler, ndn::ref(*face));
+  SyncLogicHandler& sync_hr(nlsr_hr.getSyncLogicHandler());
+
+  nlsr_hr.getConfParameter().setNetwork(CONFIG_NETWORK);
+  nlsr_hr.getConfParameter().setSiteName(CONFIG_SITE);
+  nlsr_hr.getConfParameter().setRouterName(CONFIG_ROUTER_NAME);
+  nlsr_hr.getConfParameter().buildRouterPrefix();
+
+  nlsr_hr.getConfParameter().setHyperbolicState(HYPERBOLIC_STATE_ON);
+
+  nlsr_hr.initialize();
+
+  std::string updateName = nlsr_hr.getConfParameter().getLsaPrefix().toUri() +
+                           CONFIG_SITE + "/%C1.Router/other-router/";
+
+  uint64_t syncSeqNo = 0;
+  syncSeqNo = syncSeqNo | (static_cast<uint64_t>(1) << 20);
+
+  receiveUpdate(updateName, syncSeqNo, sync_hr);
+
+  std::vector<ndn::Interest>& interests = face->sentInterests;
+  std::vector<ndn::Interest>::iterator it = interests.begin();
+
+  BOOST_REQUIRE_EQUAL(interests.size(), 2);
+
+  BOOST_CHECK_EQUAL(it->getName().getPrefix(-1), updateName + NameLsa::TYPE_STRING + "/");
+
+  ++it;
+  BOOST_CHECK_EQUAL(it->getName().getPrefix(-1), updateName + CoordinateLsa::TYPE_STRING + "/");
+}
+
+BOOST_AUTO_TEST_CASE(UpdateForOtherHRDry)
+{
+
+  Nlsr nlsr_hrdry(g_ioService, g_scheduler, ndn::ref(*face));
+  SyncLogicHandler& sync_hrdry(nlsr_hrdry.getSyncLogicHandler());
+
+  nlsr_hrdry.getConfParameter().setNetwork(CONFIG_NETWORK);
+  nlsr_hrdry.getConfParameter().setSiteName(CONFIG_SITE);
+  nlsr_hrdry.getConfParameter().setRouterName(CONFIG_ROUTER_NAME);
+  nlsr_hrdry.getConfParameter().buildRouterPrefix();
+
+  nlsr_hrdry.getConfParameter().setHyperbolicState(HYPERBOLIC_STATE_DRY_RUN);
+
+  nlsr_hrdry.initialize();
+
+  std::string updateName = nlsr.getConfParameter().getLsaPrefix().toUri() +
+                           CONFIG_SITE + "/%C1.Router/other-router/";
+
+
+  uint64_t syncSeqNo = 1;
+  syncSeqNo = syncSeqNo | (static_cast<uint64_t>(1) << 20);
+  receiveUpdate(updateName, syncSeqNo, sync_hrdry);
+
+  std::vector<ndn::Interest>& interests = face->sentInterests;
+  std::vector<ndn::Interest>::iterator it = interests.begin();
+
   BOOST_REQUIRE_EQUAL(interests.size(), 3);
 
-  std::vector<ndn::Interest>::iterator it = interests.begin();
   BOOST_CHECK_EQUAL(it->getName().getPrefix(-1), updateName + NameLsa::TYPE_STRING + "/");
 
   ++it;
@@ -94,6 +163,7 @@
 
   ++it;
   BOOST_CHECK_EQUAL(it->getName().getPrefix(-1), updateName + CoordinateLsa::TYPE_STRING + "/");
+
 }
 
 BOOST_AUTO_TEST_CASE(NoUpdateForSelf)
@@ -101,7 +171,7 @@
   std::string updateName = nlsr.getConfParameter().getLsaPrefix().toUri() +
                            CONFIG_SITE + CONFIG_ROUTER_NAME;
 
-  receiveUpdate(updateName, 1);
+  receiveUpdate(updateName, 1, sync);
 
   std::vector<ndn::Interest>& interests = face->sentInterests;
   BOOST_CHECK_EQUAL(interests.size(), 0);
@@ -143,21 +213,21 @@
 
   // Lower NameLSA sequence number
   uint64_t lowerSeqNo = static_cast<uint64_t>(998) << 40;
-  receiveUpdate(updateName, lowerSeqNo);
+  receiveUpdate(updateName, lowerSeqNo, sync);
 
   std::vector<ndn::Interest>& interests = face->sentInterests;
   BOOST_REQUIRE_EQUAL(interests.size(), 0);
 
   // Same NameLSA sequence number
   uint64_t sameSeqNo = static_cast<uint64_t>(999) << 40;
-  receiveUpdate(updateName, sameSeqNo);
+  receiveUpdate(updateName, sameSeqNo, sync);
 
   interests = face->sentInterests;
   BOOST_REQUIRE_EQUAL(interests.size(), 0);
 
   // Higher NameLSA sequence number
   uint64_t higherSeqNo = static_cast<uint64_t>(1000) << 40;
-  receiveUpdate(updateName, higherSeqNo);
+  receiveUpdate(updateName, higherSeqNo, sync);
 
   interests = face->sentInterests;
   BOOST_REQUIRE_EQUAL(interests.size(), 1);
