diff --git a/.waf-tools/pch.py b/.waf-tools/pch.py
index 087d633..1b963ae 100644
--- a/.waf-tools/pch.py
+++ b/.waf-tools/pch.py
@@ -135,10 +135,14 @@
 	ext_out=['.h']
 
 	def runnable_status(self):
+		try:
+			node_deps = self.generator.bld.node_deps[self.uid()]
+		except KeyError:
+			node_deps = []
 		ret = Task.Task.runnable_status(self)
 		if ret == Task.SKIP_ME and self.env.CXX_NAME == 'clang':
 			t = os.stat(self.outputs[0].abspath()).st_mtime
-			for n in self.inputs:
+			for n in self.inputs + node_deps:
 				if os.stat(n.abspath()).st_mtime > t:
 					return Task.RUN_ME
 		return ret
diff --git a/examples/producer.cpp b/examples/producer.cpp
index 1a2dbee..2998bd0 100644
--- a/examples/producer.cpp
+++ b/examples/producer.cpp
@@ -67,7 +67,7 @@
 
 
   void
-  onRegisterFailed(const Name& prefix, const std::string& reason)
+  onRegisterFailed(const std::string& reason)
   {
     std::cerr << "ERROR: Failed to register prefix in local hub's daemon (" << reason << ")"
               << std::endl;
@@ -80,7 +80,7 @@
     m_face.setInterestFilter("/localhost/testApp",
                              bind(&Producer::onInterest, this, _1, _2),
                              RegisterPrefixSuccessCallback(),
-                             bind(&Producer::onRegisterFailed, this, _1, _2));
+                             bind(&Producer::onRegisterFailed, this, _2));
     m_face.processEvents();
   }
 
diff --git a/src/security/certificate-extension.hpp b/src/security/certificate-extension.hpp
index 4267560..cad811f 100644
--- a/src/security/certificate-extension.hpp
+++ b/src/security/certificate-extension.hpp
@@ -94,7 +94,7 @@
     return m_extensionId;
   }
 
-  inline const bool
+  inline bool
   getIsCritical() const
   {
     return m_isCritical;
diff --git a/src/security/key-chain.hpp b/src/security/key-chain.hpp
index d4b6580..dcf2079 100644
--- a/src/security/key-chain.hpp
+++ b/src/security/key-chain.hpp
@@ -887,7 +887,7 @@
   Block sigValue = m_tpm->signInTpm(signedName.wireEncode().value(),
                                     signedName.wireEncode().value_size(),
                                     keyName,
-                                    DIGEST_ALGORITHM_SHA256);
+                                    digestAlgorithm);
   sigValue.encode();
   signedName.append(sigValue);
   interest.setName(signedName);
diff --git a/src/security/sec-public-info-memory.hpp b/src/security/sec-public-info-memory.hpp
index 1cf2488..faf9c4c 100644
--- a/src/security/sec-public-info-memory.hpp
+++ b/src/security/sec-public-info-memory.hpp
@@ -131,7 +131,7 @@
     {
     }
 
-    const KeyType
+    KeyType
     getKeyType() const
     {
       return m_keyType;
diff --git a/src/security/sec-tpm-osx.cpp b/src/security/sec-tpm-osx.cpp
index aa3347b..a5a7159 100644
--- a/src/security/sec-tpm-osx.cpp
+++ b/src/security/sec-tpm-osx.cpp
@@ -185,7 +185,7 @@
    * @param keyType
    * @returns MAC OS key type
    */
-  const CFTypeRef
+  CFTypeRef
   getSymKeyType(KeyType keyType);
 
   /**
@@ -194,7 +194,7 @@
    * @param keyType
    * @returns MAC OS key type
    */
-  const CFTypeRef
+  CFTypeRef
   getAsymKeyType(KeyType keyType);
 
   /**
@@ -203,7 +203,7 @@
    * @param keyClass
    * @returns MAC OS key class
    */
-  const CFTypeRef
+  CFTypeRef
   getKeyClass(KeyClass keyClass);
 
   /**
@@ -212,7 +212,7 @@
    * @param digestAlgo
    * @returns MAC OS algorithm id
    */
-  const CFStringRef
+  CFStringRef
   getDigestAlgorithm(DigestAlgorithm digestAlgo);
 
   /**
@@ -1010,7 +1010,7 @@
     return keyUri;
 }
 
-const CFTypeRef
+CFTypeRef
 SecTpmOsx::Impl::getAsymKeyType(KeyType keyType)
 {
   switch (keyType){
@@ -1021,7 +1021,7 @@
   }
 }
 
-const CFTypeRef
+CFTypeRef
 SecTpmOsx::Impl::getSymKeyType(KeyType keyType)
 {
   switch (keyType){
@@ -1032,7 +1032,7 @@
   }
 }
 
-const CFTypeRef
+CFTypeRef
 SecTpmOsx::Impl::getKeyClass(KeyClass keyClass)
 {
   switch (keyClass){
@@ -1047,7 +1047,7 @@
   }
 }
 
-const CFStringRef
+CFStringRef
 SecTpmOsx::Impl::getDigestAlgorithm(DigestAlgorithm digestAlgo)
 {
   switch (digestAlgo){
diff --git a/tests/unit-tests/security/test-signed-interest.cpp b/tests/unit-tests/security/test-signed-interest.cpp
index 56b05f9..8d675fc 100644
--- a/tests/unit-tests/security/test-signed-interest.cpp
+++ b/tests/unit-tests/security/test-signed-interest.cpp
@@ -66,11 +66,14 @@
 public:
   CommandInterestFixture()
     : m_validity(false)
-  {}
+  {
+  }
 
   void
   validated(const shared_ptr<const Interest>& interest)
-  { m_validity = true; }
+  {
+    m_validity = true;
+  }
 
   void
   validationFailed(const shared_ptr<const Interest>& interest, const string& failureInfo)
@@ -80,7 +83,9 @@
 
   void
   reset()
-  { m_validity = false; }
+  {
+    m_validity = false;
+  }
 
   bool m_validity;
 };
diff --git a/tests/unit-tests/security/test-validator.cpp b/tests/unit-tests/security/test-validator.cpp
index 40e667d..b8d6157 100644
--- a/tests/unit-tests/security/test-validator.cpp
+++ b/tests/unit-tests/security/test-validator.cpp
@@ -33,7 +33,9 @@
 
 void
 onValidated(const shared_ptr<const Data>& data)
-{ BOOST_CHECK(true); }
+{
+  BOOST_CHECK(true);
+}
 
 void
 onValidationFailed(const shared_ptr<const Data>& data, const string& failureInfo)
diff --git a/tools/ndncatchunks3.cpp b/tools/ndncatchunks3.cpp
index 2b0e635..d84758a 100644
--- a/tools/ndncatchunks3.cpp
+++ b/tools/ndncatchunks3.cpp
@@ -53,7 +53,7 @@
 
 private:
   void
-  onData(const Interest& interest, Data& data);
+  onData(Data& data);
 
   void
   onTimeout(const Interest& interest);
@@ -84,7 +84,7 @@
           interest.setMustBeFresh(m_mustBeFresh);
 
           m_face.expressInterest(interest,
-                                 bind(&Consumer::onData, this, _1, _2),
+                                 bind(&Consumer::onData, this, _2),
                                  bind(&Consumer::onTimeout, this, _1));
         }
 
@@ -98,7 +98,7 @@
 }
 
 void
-Consumer::onData(const Interest& interest, Data& data)
+Consumer::onData(Data& data)
 {
   const Block& content = data.getContent();
   const Name& name = data.getName();
@@ -125,7 +125,7 @@
       interest.setMustBeFresh(m_mustBeFresh);
 
       m_face.expressInterest(interest,
-                             bind(&Consumer::onData, this, _1, _2),
+                             bind(&Consumer::onData, this, _2),
                              bind(&Consumer::onTimeout, this, _1));
     }
 }
diff --git a/tools/ndnputchunks3.cpp b/tools/ndnputchunks3.cpp
index 532b952..ca9475a 100644
--- a/tools/ndnputchunks3.cpp
+++ b/tools/ndnputchunks3.cpp
@@ -62,7 +62,7 @@
   }
 
   void
-  onInterest(const Name& name, const Interest& interest)
+  onInterest(const Interest& interest)
   {
     if (m_isVerbose)
       std::cerr << "<< I: " << interest << std::endl;
@@ -78,7 +78,9 @@
   void
   onRegisterFailed(const Name& prefix, const std::string& reason)
   {
-    std::cerr << "ERROR: Failed to register prefix in local hub's daemon (" << reason << ")" << std::endl;
+    std::cerr << "ERROR: Failed to register prefix '"
+              << prefix << "' in local hub's daemon (" << reason << ")"
+              << std::endl;
     m_face.shutdown();
   }
 
@@ -92,7 +94,7 @@
       }
 
     m_face.setInterestFilter(m_name,
-                             bind(&Producer::onInterest, this, _1, _2),
+                             bind(&Producer::onInterest, this, _2),
                              RegisterPrefixSuccessCallback(),
                              bind(&Producer::onRegisterFailed, this, _1, _2));
     m_face.processEvents();
