diff --git a/daemon/face/local-face.hpp b/daemon/face/local-face.hpp
index c54374c..e2bf479 100644
--- a/daemon/face/local-face.hpp
+++ b/daemon/face/local-face.hpp
@@ -152,9 +152,11 @@
         i->wireDecode(payload);
         if (&payload != &element)
           {
-            i->getLocalControlHeader().wireDecode(element,
-              false,
-              this->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
+            uint8_t mask = 0;
+            if (this->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID)) {
+              mask |= ndn::nfd::LocalControlHeader::ENCODE_NEXT_HOP;
+            }
+            i->getLocalControlHeader().wireDecode(element, mask);
           }
 
         this->emitSignal(onReceiveInterest, *i);
@@ -193,17 +195,22 @@
   if (!this->isLocalControlHeaderEnabled())
     return true;
 
-  return header.empty(this->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID),
-                      false);
+  uint8_t mask = 0;
+  if (this->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID)) {
+    mask |= ndn::nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID;
+  }
+  return header.empty(mask);
 }
 
 template<class Packet>
 inline Block
 LocalFace::filterAndEncodeLocalControlHeader(const Packet& packet)
 {
-  return packet.getLocalControlHeader().wireEncode(packet,
-           this->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID),
-           false);
+  uint8_t mask = 0;
+  if (this->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID)) {
+    mask |= ndn::nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID;
+  }
+  return packet.getLocalControlHeader().wireEncode(packet, mask);
 }
 
 } // namespace nfd
diff --git a/tests/daemon/face/unix-stream.cpp b/tests/daemon/face/unix-stream.cpp
index 02a48d9..a8390fb 100644
--- a/tests/daemon/face/unix-stream.cpp
+++ b/tests/daemon/face/unix-stream.cpp
@@ -382,13 +382,17 @@
   using namespace boost::asio;
 
   std::vector<const_buffer> interestWithHeader;
-  Block iHeader  = interest1->getLocalControlHeader().wireEncode(*interest1, true, true);
+  Block iHeader  = interest1->getLocalControlHeader().wireEncode(*interest1,
+    ndn::nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID |
+    ndn::nfd::LocalControlHeader::ENCODE_NEXT_HOP);
   Block iPayload = interest1->wireEncode();
   interestWithHeader.push_back(buffer(iHeader.wire(),  iHeader.size()));
   interestWithHeader.push_back(buffer(iPayload.wire(), iPayload.size()));
 
   std::vector<const_buffer> dataWithHeader;
-  Block dHeader  = data1->getLocalControlHeader().wireEncode(*data1, true, true);
+  Block dHeader  = data1->getLocalControlHeader().wireEncode(*data1,
+    ndn::nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID |
+    ndn::nfd::LocalControlHeader::ENCODE_NEXT_HOP);
   Block dPayload = data1->wireEncode();
   dataWithHeader.push_back(buffer(dHeader.wire(),  dHeader.size()));
   dataWithHeader.push_back(buffer(dPayload.wire(), dPayload.size()));
