diff --git a/common.hpp b/common.hpp
index d59fa9c..59e6828 100644
--- a/common.hpp
+++ b/common.hpp
@@ -78,7 +78,6 @@
 using ndn::Block;
 using ndn::ConstBufferPtr;
 using ndn::Data;
-using ndn::Exclude;
 using ndn::Interest;
 using ndn::Name;
 using ndn::security::v2::ValidationError;
diff --git a/src/logic.cpp b/src/logic.cpp
index ab0b794..35480ee 100644
--- a/src/logic.cpp
+++ b/src/logic.cpp
@@ -360,8 +360,7 @@
   else if (name.size() >= 2 && RECOVERY_COMPONENT == name.get(-2)) {
     processRecoveryInterest(interest);
   }
-  // Do not process exclude interests, they should be answered by CS
-  else if (interest.getExclude().empty()) {
+  else {
     processSyncInterest(interest);
   }
 
@@ -379,22 +378,12 @@
 Logic::onSyncData(const Interest& interest, const Data& data)
 {
   _LOG_DEBUG_ID(">> Logic::onSyncData");
-  // if (static_cast<bool>(m_validator))
-  //   m_validator->validate(data,
-  //                         bind(&Logic::onSyncDataValidated, this, _1),
-  //                         bind(&Logic::onSyncDataValidationFailed, this, _1));
-  // else
-  //   onSyncDataValidated(data);
-
-  if (interest.getExclude().empty()) {
-    _LOG_DEBUG_ID("First data");
-    onSyncDataValidated(data);
-  }
-  else {
-    _LOG_DEBUG_ID("Data obtained using exclude filter");
-    onSyncDataValidated(data, false);
-  }
-  // sendExcludeInterest(interest, data);
+  if (m_validator != nullptr)
+    m_validator->validate(data,
+                          bind(&Logic::onSyncDataValidated, this, _1),
+                          bind(&Logic::onSyncDataValidationFailed, this, _1));
+  else
+     onSyncDataValidated(data);
 
   _LOG_DEBUG_ID("<< Logic::onSyncData");
 }
@@ -421,7 +410,7 @@
 }
 
 void
-Logic::onSyncDataValidated(const Data& data, bool firstData)
+Logic::onSyncDataValidated(const Data& data)
 {
   Name name = data.getName();
   ConstBufferPtr digest = make_shared<ndn::Buffer>(name.get(-1).value(), name.get(-1).value_size());
@@ -429,7 +418,7 @@
   try {
     auto contentBuffer = bzip2::decompress(reinterpret_cast<const char*>(data.getContent().value()),
                                            data.getContent().value_size());
-    processSyncData(name, digest, Block(contentBuffer), firstData);
+    processSyncData(name, digest, Block(std::move(contentBuffer)));
   }
   catch (const std::ios_base::failure& error) {
     _LOG_WARN("Error decompressing content of " << data.getName() << " (" << error.what() << ")");
@@ -526,8 +515,7 @@
 void
 Logic::processSyncData(const Name& name,
                        ConstBufferPtr digest,
-                       const Block& syncReplyBlock,
-                       bool firstData)
+                       const Block& syncReplyBlock)
 {
   _LOG_DEBUG_ID(">> Logic::processSyncData");
   DiffStatePtr commit = make_shared<DiffState>();
@@ -577,7 +565,7 @@
     return;
   }
 
-  if (static_cast<bool>(commit) && !commit->getLeaves().empty() && firstData) {
+  if (static_cast<bool>(commit) && !commit->getLeaves().empty()) {
     // state changed and it is safe to express a new interest
     time::steady_clock::Duration after = time::milliseconds(m_reexpressionJitter(m_rng));
     _LOG_DEBUG_ID("Reschedule sync interest after: " << after);
@@ -644,6 +632,7 @@
 
   Interest interest(m_syncReset);
   interest.setMustBeFresh(true);
+  interest.setCanBePrefix(false); // no data is expected
   interest.setInterestLifetime(m_resetInterestLifetime);
   const ndn::PendingInterestId* pendingInterestId = m_face.expressInterest(interest,
     bind(&Logic::onResetData, this, _1, _2),
@@ -681,6 +670,7 @@
 
   Interest interest(interestName);
   interest.setMustBeFresh(true);
+  interest.setCanBePrefix(true);
   interest.setInterestLifetime(m_syncInterestLifetime);
 
   if (m_outstandingInterestId != nullptr) {
@@ -815,6 +805,7 @@
 
   Interest interest(interestName);
   interest.setMustBeFresh(true);
+  interest.setCanBePrefix(true);
   interest.setInterestLifetime(m_recoveryInterestLifetime);
 
   const ndn::PendingInterestId* pendingInterestId = m_face.expressInterest(interest,
diff --git a/src/logic.hpp b/src/logic.hpp
index f901bb4..a71080f 100644
--- a/src/logic.hpp
+++ b/src/logic.hpp
@@ -315,10 +315,9 @@
    * This method simply passes the valid reply to processSyncData.
    *
    * @param data The valid Sync Reply.
-   * @param firstData Whether the data is new or that obtained using exclude filter
    */
   void
-  onSyncDataValidated(const Data& data, bool firstData = true);
+  onSyncDataValidated(const Data& data);
 
   /**
    * @brief Process normal Sync Interest
@@ -355,13 +354,11 @@
    * @param name           The data name of the Sync Reply.
    * @param digest         The digest in the data name.
    * @param syncReplyBlock The content of the Sync Reply.
-   * @param firstData      Whether the data is new or obtained using exclude filter
    */
   void
   processSyncData(const Name& name,
                   ConstBufferPtr digest,
-                  const Block& syncReplyBlock,
-                  bool firstData);
+                  const Block& syncReplyBlock);
 
   /**
    * @brief Insert state diff into log
diff --git a/src/socket.cpp b/src/socket.cpp
index 4468fb7..02725f2 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -177,6 +177,7 @@
 
   Interest interest(interestName);
   interest.setMustBeFresh(true);
+  interest.setCanBePrefix(false);
 
   DataValidationErrorCallback failureCallback =
     bind(&Socket::onDataValidationFailed, this, _1, _2);
@@ -202,6 +203,7 @@
 
   Interest interest(interestName);
   interest.setMustBeFresh(true);
+  interest.setCanBePrefix(false);
 
   m_face.expressInterest(interest,
                          bind(&Socket::onData, this, _1, _2, dataCallback, failureCallback),
