diff --git a/src/consumer.cpp b/src/consumer.cpp
index 04f8b4a..84adc2a 100644
--- a/src/consumer.cpp
+++ b/src/consumer.cpp
@@ -101,7 +101,7 @@
 
   m_helloFetcher->afterSegmentValidated.connect([this] (const ndn::Data& data) {
                                                   if (data.getFinalBlock()) {
-                                                    m_helloDataName = data.getName().getPrefix(-1);
+                                                    m_helloDataName = data.getName().getPrefix(-2);
                                                   }
                                                 });
 
@@ -189,7 +189,7 @@
 
   m_syncFetcher->afterSegmentValidated.connect([this] (const ndn::Data& data) {
                                                  if (data.getFinalBlock()) {
-                                                   m_syncDataName = data.getName().getPrefix(-1);
+                                                   m_syncDataName = data.getName().getPrefix(-2);
                                                    m_syncDataContentType = data.getContentType();
                                                  }
 
diff --git a/src/full-producer.cpp b/src/full-producer.cpp
index 0953f93..133eebe 100644
--- a/src/full-producer.cpp
+++ b/src/full-producer.cpp
@@ -137,16 +137,14 @@
 
   ndn::Name nameWithoutSyncPrefix = interest.getName().getSubName(prefixName.size());
   ndn::Name interestName;
-  uint64_t interestSeq = 0;
 
   if (nameWithoutSyncPrefix.size() == 1) {
-    // Get /IBF from /IBF
+    // Get /<prefix>/IBF from /<prefix>/IBF
     interestName = interest.getName();
   }
-  else if (nameWithoutSyncPrefix.size() == 2) {
-    // Get /IBF from /IBF/<seq-no>
-    interestName = interest.getName().getPrefix(-1);
-    interestSeq = interest.getName().get(-1).toSegment();
+  else if (nameWithoutSyncPrefix.size() == 3) {
+    // Get /<prefix>/IBF from /<prefix>/IBF/<version>/<segment-no>
+    interestName = interest.getName().getPrefix(-2);
   }
   else {
     return;
@@ -207,9 +205,6 @@
 
   if (!state.getContent().empty()) {
     NDN_LOG_DEBUG("Sending sync content: " << state);
-    if (interestSeq != 0) {
-      interestName.appendSegment(interestSeq);
-    }
     sendSyncData(interestName, state.wireEncode());
     return;
   }
diff --git a/src/partial-producer.cpp b/src/partial-producer.cpp
index b0d29f1..e1570fe 100644
--- a/src/partial-producer.cpp
+++ b/src/partial-producer.cpp
@@ -74,14 +74,14 @@
 void
 PartialProducer::onHelloInterest(const ndn::Name& prefix, const ndn::Interest& interest)
 {
-  // Last component or third last component (in case of interest with IBF and segment)
-  // needs to be hello
-  if (interest.getName().get(interest.getName().size()-1).toUri() != "hello" &&
-      interest.getName().get(interest.getName().size()-3).toUri() != "hello") {
+  if (m_segmentPublisher.replyFromStore(interest.getName())) {
     return;
   }
 
-  if (m_segmentPublisher.replyFromStore(interest.getName())) {
+  // Last component or fourth last component (in case of interest with version and segment)
+  // needs to be hello
+  if (interest.getName().get(interest.getName().size()-1).toUri() != "hello" &&
+      interest.getName().get(interest.getName().size()-4).toUri() != "hello") {
     return;
   }
 
@@ -104,17 +104,25 @@
 void
 PartialProducer::onSyncInterest(const ndn::Name& prefix, const ndn::Interest& interest)
 {
-  NDN_LOG_DEBUG("Sync Interest Received, nonce: " << interest.getNonce() <<
-                " hash: " << std::hash<std::string>{}(interest.getName().toUri()));
-
-  ndn::Name interestName = interest.getName();
-
-  if (interestName.get(interestName.size() - 5).toUri() != "sync" &&
-      interestName.get(interestName.size() - 7).toUri() != "sync") {
+  if (m_segmentPublisher.replyFromStore(interest.getName())) {
     return;
   }
 
-  if (m_segmentPublisher.replyFromStore(interest.getName())) {
+  NDN_LOG_DEBUG("Sync Interest Received, nonce: " << interest.getNonce() <<
+                " hash: " << std::hash<std::string>{}(interest.getName().toUri()));
+
+  ndn::Name nameWithoutSyncPrefix = interest.getName().getSubName(prefix.size());
+  ndn::Name interestName;
+
+  if (nameWithoutSyncPrefix.size() == 4) {
+    // Get /<prefix>/BF/IBF/ from /<prefix>/BF/IBF (3 components of BF + 1 for IBF)
+    interestName = interest.getName();
+  }
+  else if (nameWithoutSyncPrefix.size() == 6) {
+    // Get <prefix>/BF/IBF/ from /<prefix>/BF/IBF/<version>/<segment-no>
+    interestName = interest.getName().getPrefix(-2);
+  }
+  else {
     return;
   }
 
diff --git a/src/partial-producer.hpp b/src/partial-producer.hpp
index cb014fc..de12fb8 100644
--- a/src/partial-producer.hpp
+++ b/src/partial-producer.hpp
@@ -97,6 +97,7 @@
   void
   satisfyPendingSyncInterests(const ndn::Name& prefix);
 
+PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   /**
    * @brief Receive hello interest from consumer and respond with hello data
    *
@@ -105,7 +106,6 @@
   void
   onHelloInterest(const ndn::Name& prefix, const ndn::Interest& interest);
 
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   /**
    * @brief Receive sync interest from consumer
    *
diff --git a/src/segment-publisher.cpp b/src/segment-publisher.cpp
index d78d47f..394dfc5 100644
--- a/src/segment-publisher.cpp
+++ b/src/segment-publisher.cpp
@@ -34,7 +34,8 @@
 
 void
 SegmentPublisher::publish(const ndn::Name& interestName, const ndn::Name& dataName,
-                          const ndn::Block& block, ndn::time::milliseconds freshness)
+                          const ndn::Block& block, ndn::time::milliseconds freshness,
+                          const ndn::security::SigningInfo& signingInfo)
 {
   uint64_t interestSegment = 0;
   if (interestName[-1].isSegment()) {
@@ -52,6 +53,9 @@
 
   uint64_t totalSegments = buffer.size() / maxPacketSize;
 
+  ndn::Name segmentPrefix(dataName);
+  segmentPrefix.appendVersion();
+
   uint64_t segmentNo = 0;
   do {
     const uint8_t* segmentEnd = segmentBegin + maxPacketSize;
@@ -59,7 +63,7 @@
       segmentEnd = end;
     }
 
-    ndn::Name segmentName(dataName);
+    ndn::Name segmentName(segmentPrefix);
     segmentName.appendSegment(segmentNo);
 
     // We get a std::exception: bad_weak_ptr from m_ims if we don't use shared_ptr for data
@@ -70,7 +74,7 @@
 
     segmentBegin = segmentEnd;
 
-    m_keyChain.sign(*data);
+    m_keyChain.sign(*data, signingInfo);
 
     // Put on face only the segment which has a pending interest
     // otherwise the segment is unsolicited
diff --git a/src/segment-publisher.hpp b/src/segment-publisher.hpp
index b23ac52..8e00624 100644
--- a/src/segment-publisher.hpp
+++ b/src/segment-publisher.hpp
@@ -54,7 +54,9 @@
    */
   void
   publish(const ndn::Name& interestName, const ndn::Name& dataName,
-          const ndn::Block& block, ndn::time::milliseconds freshness);
+          const ndn::Block& block, ndn::time::milliseconds freshness,
+          const ndn::security::SigningInfo& signingInfo =
+            ndn::security::v2::KeyChain::getDefaultSigningInfo());
 
   /**
    * @brief Try to reply from memory, return false if we cannot find the segment.
