diff --git a/src/management/nfd-controller.cpp b/src/management/nfd-controller.cpp
index 0a56777..5fc755d 100644
--- a/src/management/nfd-controller.cpp
+++ b/src/management/nfd-controller.cpp
@@ -45,10 +45,15 @@
 void
 Controller::startCommand(const shared_ptr<ControlCommand>& command,
                          const ControlParameters& parameters,
-                         const CommandSucceedCallback& onSuccess,
-                         const CommandFailCallback& onFailure,
+                         const CommandSucceedCallback& onSuccess1,
+                         const CommandFailCallback& onFailure1,
                          const CommandOptions& options)
 {
+  const CommandSucceedCallback& onSuccess = onSuccess1 ?
+    onSuccess1 : [] (const ControlParameters&) {};
+  const CommandFailCallback& onFailure = onFailure1 ?
+    onFailure1 : [] (uint32_t, const std::string&) {};
+
   Name requestName = command->getRequestName(options.getPrefix(), parameters);
   Interest interest(requestName);
   interest.setInterestLifetime(options.getTimeout());
@@ -73,16 +78,14 @@
   try {
     response.wireDecode(data.getContent().blockFromValue());
   }
-  catch (tlv::Error& e) {
-    if (static_cast<bool>(onFailure))
-      onFailure(ERROR_SERVER, e.what());
+  catch (const tlv::Error& e) {
+    onFailure(ERROR_SERVER, e.what());
     return;
   }
 
   uint32_t code = response.getCode();
   if (code >= ERROR_LBOUND) {
-    if (static_cast<bool>(onFailure))
-      onFailure(code, response.getText());
+    onFailure(code, response.getText());
     return;
   }
 
@@ -90,23 +93,20 @@
   try {
     parameters.wireDecode(response.getBody());
   }
-  catch (tlv::Error& e) {
-    if (static_cast<bool>(onFailure))
-      onFailure(ERROR_SERVER, e.what());
+  catch (const tlv::Error& e) {
+    onFailure(ERROR_SERVER, e.what());
     return;
   }
 
   try {
     command->validateResponse(parameters);
   }
-  catch (ControlCommand::ArgumentError& e) {
-    if (static_cast<bool>(onFailure))
-      onFailure(ERROR_SERVER, e.what());
+  catch (const ControlCommand::ArgumentError& e) {
+    onFailure(ERROR_SERVER, e.what());
     return;
   }
 
-  if (static_cast<bool>(onSuccess))
-    onSuccess(parameters);
+  onSuccess(parameters);
 }
 
 void
diff --git a/src/management/nfd-controller.hpp b/src/management/nfd-controller.hpp
index 3ae1cf2..9fa721b 100644
--- a/src/management/nfd-controller.hpp
+++ b/src/management/nfd-controller.hpp
@@ -164,10 +164,15 @@
 template<typename Dataset>
 inline void
 Controller::fetchDataset(shared_ptr<Dataset> dataset,
-                         const std::function<void(typename Dataset::ResultType)>& onSuccess,
-                         const CommandFailCallback& onFailure,
+                         const std::function<void(typename Dataset::ResultType)>& onSuccess1,
+                         const CommandFailCallback& onFailure1,
                          const CommandOptions& options)
 {
+  const std::function<void(typename Dataset::ResultType)>& onSuccess = onSuccess1 ?
+    onSuccess1 : [] (const typename Dataset::ResultType&) {};
+  const CommandFailCallback& onFailure = onFailure1 ?
+    onFailure1 : [] (uint32_t, const std::string&) {};
+
   Name prefix = dataset->getDatasetPrefix(options.getPrefix());
   this->fetchDataset(prefix,
                      bind(&Controller::processDatasetResponse<Dataset>, this, dataset, onSuccess, onFailure, _1),
@@ -190,6 +195,7 @@
     onFailure(ERROR_SERVER, ex.what());
     return;
   }
+
   onSuccess(result);
 }
 
