diff --git a/src/management/ndnd-controller.cpp b/src/management/ndnd-controller.cpp
index a897e27..486a611 100644
--- a/src/management/ndnd-controller.cpp
+++ b/src/management/ndnd-controller.cpp
@@ -63,13 +63,26 @@
 }
 
 
-void 
+void
 Controller::onNdnidFetched(const Interest& interest, Data& data)
 {
   if (data.getName().size() > interest.getName().size())
     {
       m_ndndId = data.getName()[interest.getName().size()];
 
+      if (m_ndndId.value_size() < 6)
+        {
+          for (FilterRequestList::iterator i = m_filterRequests.begin();
+               i != m_filterRequests.end();
+               ++i)
+            {
+              if (static_cast<bool>(i->m_onFailure))
+                i->m_onFailure("Fetched unrecognized NDNID");
+            }
+
+          return;
+        }
+
       for (FilterRequestList::iterator i = m_filterRequests.begin();
            i != m_filterRequests.end();
            ++i)
@@ -110,7 +123,7 @@
   Data data;
   data.setName(Name().appendVersion(ndn::random::generateWord32()));
   data.setContent(entry.wireEncode());
-  
+
   // Create an empty signature, since nobody going to verify it for now
   // @todo In the future, we may require real signatures to do the registration
   SignatureSha256WithRsa signature;
@@ -120,7 +133,7 @@
   // Create an interest where the name has the encoded Data packet.
   Name interestName;
   interestName.append("ndnx");
-  interestName.append(m_ndndId);
+  interestName.append(m_ndndId.value_begin()+6, m_ndndId.value_end());
   interestName.append(entry.getAction());
   interestName.append(data.wireEncode());
 
@@ -143,7 +156,7 @@
   Data data;
   data.setName(Name().appendVersion(random::generateWord32()));
   data.setContent(entry.wireEncode());
-  
+
   // Create an empty signature, since nobody going to verify it for now
   // @todo In the future, we may require real signatures to do the registration
   SignatureSha256WithRsa signature;
@@ -153,7 +166,7 @@
   // Create an interest where the name has the encoded Data packet.
   Name interestName;
   interestName.append("ndnx");
-  interestName.append(m_ndndId);
+  interestName.append(m_ndndId.value_begin()+6, m_ndndId.value_end());
   interestName.append(entry.getAction());
   interestName.append(data.wireEncode());
 
@@ -183,7 +196,7 @@
     }
 
   Block::element_const_iterator val = content.elements_begin();
-  
+
   switch(val->type())
     {
     case Tlv::FaceManagement::FaceInstance:
@@ -229,7 +242,7 @@
     }
 
   Block::element_const_iterator val = content.elements_begin();
-  
+
   switch(val->type())
     {
     case Tlv::FaceManagement::ForwardingEntry:
@@ -247,7 +260,7 @@
         resp.wireDecode(*val);
 
         // std::cerr << "StatusReponse: " << resp << std::endl;
-      
+
         if (static_cast<bool>(onFail))
           onFail(resp.getInfo());
         return;
