diff --git a/src/validator/certificate-fetcher-ndns-appcert.cpp b/src/validator/certificate-fetcher-ndns-appcert.cpp
index 99e7f21..e451e96 100644
--- a/src/validator/certificate-fetcher-ndns-appcert.cpp
+++ b/src/validator/certificate-fetcher-ndns-appcert.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018, Regents of the University of California.
+ * Copyright (c) 2014-2019, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -69,12 +69,11 @@
                                                   const ValidationContinuation& continueValidation)
 {
   m_validator->validate(data,
-                        [=] (const Data& data) {
-                          onValidationSuccessCallback(data, certRequest, state, continueValidation);
+                        [=] (const Data& d) {
+                          onValidationSuccessCallback(d, certRequest, state, continueValidation);
                         },
-                        [=] (const Data& data,
-                             const security::v2::ValidationError& errStr) {
-                          onValidationFailCallback(errStr, certRequest, state, continueValidation);
+                        [=] (const Data&, const security::v2::ValidationError& err) {
+                          onValidationFailCallback(err, certRequest, state, continueValidation);
                         });
 }
 
@@ -84,6 +83,7 @@
                                                const shared_ptr<security::v2::ValidationState>& state,
                                                const ValidationContinuation& continueValidation)
 {
+  state->removeTag<IterativeQueryTag>();
   state->fail({security::v2::ValidationError::Code::CANNOT_RETRIEVE_CERT, "Cannot fetch certificate due to " +
                errMsg + " `" + certRequest->interest.getName().toUri() + "`"});
 }
@@ -94,10 +94,12 @@
                                                        const shared_ptr<security::v2::ValidationState>& state,
                                                        const ValidationContinuation& continueValidation)
 {
+  state->removeTag<IterativeQueryTag>();
+
   if (data.getContentType() == NDNS_NACK) {
-    state->fail({security::v2::ValidationError::Code::CANNOT_RETRIEVE_CERT, "Cannot fetch certificate: get a Nack "
-                 "in query `" + certRequest->interest.getName().toUri() + "`"});
-    return;
+    return state->fail({security::v2::ValidationError::Code::CANNOT_RETRIEVE_CERT,
+                        "Cannot fetch certificate: got Nack for query `" +
+                        certRequest->interest.getName().toUri() + "`"});
   }
 
   Certificate cert;
@@ -105,9 +107,10 @@
     cert = Certificate(data.getContent().blockFromValue());
   }
   catch (const ndn::tlv::Error& e) {
-    return state->fail({security::v2::ValidationError::Code::MALFORMED_CERT, "Fetched a malformed certificate "
-          "`" + data.getName().toUri() + "` (" + e.what() + ")"});
+    return state->fail({security::v2::ValidationError::Code::MALFORMED_CERT, "Fetched a malformed "
+                        "certificate `" + data.getName().toUri() + "` (" + e.what() + ")"});
   }
+
   continueValidation(cert, state);
 }
 
@@ -117,6 +120,7 @@
                                                     const shared_ptr<security::v2::ValidationState>& state,
                                                     const ValidationContinuation& continueValidation)
 {
+  state->removeTag<IterativeQueryTag>();
   state->fail({security::v2::ValidationError::Code::CANNOT_RETRIEVE_CERT,
                "Cannot fetch certificate due to NDNS validation error: " +
                err.getInfo() + " `" + certRequest->interest.getName().toUri() + "`"});
diff --git a/src/validator/certificate-fetcher-ndns-cert.cpp b/src/validator/certificate-fetcher-ndns-cert.cpp
index b5a0b9f..bf64515 100644
--- a/src/validator/certificate-fetcher-ndns-cert.cpp
+++ b/src/validator/certificate-fetcher-ndns-cert.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018, Regents of the University of California.
+ * Copyright (c) 2014-2019, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -38,14 +38,14 @@
   : m_face(face)
   , m_nsCache(make_unique<InMemoryStorageFifo>(nsCacheSize))
   , m_startComponentIndex(startComponentIndex)
-{}
+{
+}
 
 void
 CertificateFetcherNdnsCert::doFetch(const shared_ptr<security::v2::CertificateRequest>& certRequest,
                                     const shared_ptr<security::v2::ValidationState>& state,
                                     const ValidationContinuation& continueValidation)
 {
-  using IterativeQueryTag = SimpleTag<shared_ptr<IterativeQueryController>, 1086>;
   const Name& key = certRequest->interest.getName();
   Name domain = calculateDomain(key);
   if (domain.size() == m_startComponentIndex) {
@@ -54,7 +54,7 @@
                    + " is globally routable because startComponentIndex="
                    + std::to_string(m_startComponentIndex),
                    certRequest, state, continueValidation);
-    return ;
+    return;
   }
 
   auto query = std::make_shared<IterativeQueryController>(domain,
@@ -124,13 +124,13 @@
   interestName.append(label::CERT_RR_TYPE);
   Interest interest(interestName);
   m_face.expressInterest(interest,
-                         [=] (const Interest& interest, const Data& data) {
+                         [=] (const Interest&, const Data& data) {
                            dataCallback(data, certRequest, state, continueValidation);
                          },
-                         [=] (const Interest& interest, const lp::Nack& nack) {
+                         [=] (const Interest&, const lp::Nack& nack) {
                            nackCallback(nack, certRequest, state, continueValidation);
                          },
-                         [=] (const Interest& interest) {
+                         [=] (const Interest&) {
                            timeoutCallback(certRequest, state, continueValidation);
                          });
 }
@@ -154,14 +154,17 @@
 {
   NDNS_LOG_DEBUG("Fetched certificate from network " << data.getName());
 
+  state->removeTag<IterativeQueryTag>();
+
   Certificate cert;
   try {
     cert = Certificate(data);
   }
   catch (const ndn::tlv::Error& e) {
-    return state->fail({security::v2::ValidationError::Code::MALFORMED_CERT, "Fetched a malformed certificate "
-                        "`" + data.getName().toUri() + "` (" + e.what() + ")"});
+    return state->fail({security::v2::ValidationError::Code::MALFORMED_CERT, "Fetched a malformed "
+                        "certificate `" + data.getName().toUri() + "` (" + e.what() + ")"});
   }
+
   continueValidation(cert, state);
 }
 
@@ -180,8 +183,9 @@
     fetch(certRequest, state, continueValidation);
   }
   else {
-    state->fail({security::v2::ValidationError::Code::CANNOT_RETRIEVE_CERT, "Cannot fetch certificate after all "
-                 "retries `" + certRequest->interest.getName().toUri() + "`"});
+    state->removeTag<IterativeQueryTag>();
+    state->fail({security::v2::ValidationError::Code::CANNOT_RETRIEVE_CERT, "Cannot fetch certificate "
+                 "after all retries `" + certRequest->interest.getName().toUri() + "`"});
   }
 }
 
@@ -198,8 +202,9 @@
     fetch(certRequest, state, continueValidation);
   }
   else {
-    state->fail({security::v2::ValidationError::Code::CANNOT_RETRIEVE_CERT, "Cannot fetch certificate after all "
-                 "retries `" + certRequest->interest.getName().toUri() + "`"});
+    state->removeTag<IterativeQueryTag>();
+    state->fail({security::v2::ValidationError::Code::CANNOT_RETRIEVE_CERT, "Cannot fetch certificate "
+                 "after all retries `" + certRequest->interest.getName().toUri() + "`"});
   }
 }
 
