diff --git a/daemon/fw/ncc-strategy.cpp b/daemon/fw/ncc-strategy.cpp
index d0b43f1..6e856cc 100644
--- a/daemon/fw/ncc-strategy.cpp
+++ b/daemon/fw/ncc-strategy.cpp
@@ -20,8 +20,8 @@
 {
 }
 
-const time::nanoseconds NccStrategy::DEFER_FIRST_WITHOUT_BEST_FACE = time::microseconds(4000);
-const time::nanoseconds NccStrategy::DEFER_RANGE_WITHOUT_BEST_FACE = time::microseconds(75000);
+const time::microseconds NccStrategy::DEFER_FIRST_WITHOUT_BEST_FACE = time::microseconds(4000);
+const time::microseconds NccStrategy::DEFER_RANGE_WITHOUT_BEST_FACE = time::microseconds(75000);
 const time::nanoseconds NccStrategy::MEASUREMENTS_LIFETIME = time::seconds(16);
 
 void
@@ -38,30 +38,29 @@
 
   shared_ptr<PitEntryInfo> pitEntryInfo =
     pitEntry->getOrCreateStrategyInfo<PitEntryInfo>();
-  bool isNewInterest = pitEntryInfo->m_isNewInterest;
+  bool isNewInterest = pitEntryInfo->isNewInterest;
   if (!isNewInterest) {
     return;
   }
-  pitEntryInfo->m_isNewInterest = false;
+  pitEntryInfo->isNewInterest = false;
 
   shared_ptr<MeasurementsEntryInfo> measurementsEntryInfo =
     this->getMeasurementsEntryInfo(pitEntry);
 
-  time::nanoseconds deferFirst = DEFER_FIRST_WITHOUT_BEST_FACE;
-  time::nanoseconds deferRange = DEFER_RANGE_WITHOUT_BEST_FACE;
+  time::microseconds deferFirst = DEFER_FIRST_WITHOUT_BEST_FACE;
+  time::microseconds deferRange = DEFER_RANGE_WITHOUT_BEST_FACE;
   size_t nUpstreams = nexthops.size();
 
   shared_ptr<Face> bestFace = measurementsEntryInfo->getBestFace();
   if (static_cast<bool>(bestFace) && fibEntry->hasNextHop(bestFace) &&
       pitEntry->canForwardTo(*bestFace)) {
     // TODO Should we use `randlow = 100 + nrand48(h->seed) % 4096U;` ?
-    deferFirst = measurementsEntryInfo->m_prediction;
-    deferRange = time::nanoseconds((deferFirst.count() +
-                              static_cast<time::nanoseconds>(time::microseconds(1)).count()) / 2);
+    deferFirst = measurementsEntryInfo->prediction;
+    deferRange = time::microseconds((deferFirst.count() + 1) / 2);
     --nUpstreams;
     this->sendInterest(pitEntry, bestFace);
-    pitEntryInfo->m_bestFaceTimeout = scheduler::schedule(
-      measurementsEntryInfo->m_prediction,
+    pitEntryInfo->bestFaceTimeout = scheduler::schedule(
+      measurementsEntryInfo->prediction,
       bind(&NccStrategy::timeoutOnBestFace, this, weak_ptr<pit::Entry>(pitEntry)));
   }
   else {
@@ -70,15 +69,17 @@
     // TODO avoid sending to inFace
   }
 
-  shared_ptr<Face> previousFace = measurementsEntryInfo->m_previousFace.lock();
+  shared_ptr<Face> previousFace = measurementsEntryInfo->previousFace.lock();
   if (static_cast<bool>(previousFace) && fibEntry->hasNextHop(previousFace) &&
       pitEntry->canForwardTo(*previousFace)) {
     --nUpstreams;
   }
 
-  pitEntryInfo->m_maxInterval = std::max(static_cast<time::nanoseconds>(time::microseconds(1)),
-    time::nanoseconds((2 * deferRange.count() + nUpstreams - 1) / nUpstreams));
-  pitEntryInfo->m_propagateTimer = scheduler::schedule(deferFirst,
+  if (nUpstreams > 0) {
+    pitEntryInfo->maxInterval = std::max(time::microseconds(1),
+      time::microseconds((2 * deferRange.count() + nUpstreams - 1) / nUpstreams));
+  }
+  pitEntryInfo->propagateTimer = scheduler::schedule(deferFirst,
     bind(&NccStrategy::doPropagate, this,
          weak_ptr<pit::Entry>(pitEntry), weak_ptr<fib::Entry>(fibEntry)));
 }
@@ -95,14 +96,15 @@
     return;
   }
 
-  shared_ptr<PitEntryInfo> pitEntryInfo =
-    pitEntry->getStrategyInfo<PitEntryInfo>();
+  shared_ptr<PitEntryInfo> pitEntryInfo = pitEntry->getStrategyInfo<PitEntryInfo>();
+  // pitEntryInfo is guaranteed to exist here, because doPropagate is triggered
+  // from a timer set by NccStrategy.
   BOOST_ASSERT(static_cast<bool>(pitEntryInfo));
 
   shared_ptr<MeasurementsEntryInfo> measurementsEntryInfo =
     this->getMeasurementsEntryInfo(pitEntry);
 
-  shared_ptr<Face> previousFace = measurementsEntryInfo->m_previousFace.lock();
+  shared_ptr<Face> previousFace = measurementsEntryInfo->previousFace.lock();
   if (static_cast<bool>(previousFace) && fibEntry->hasNextHop(previousFace) &&
       pitEntry->canForwardTo(*previousFace)) {
     this->sendInterest(pitEntry, previousFace);
@@ -121,8 +123,8 @@
 
   if (isForwarded) {
     static unsigned short seed[3];
-    time::nanoseconds deferNext = time::nanoseconds(nrand48(seed) % pitEntryInfo->m_maxInterval.count());
-    pitEntryInfo->m_propagateTimer = scheduler::schedule(deferNext,
+    time::nanoseconds deferNext = time::nanoseconds(nrand48(seed) % pitEntryInfo->maxInterval.count());
+    pitEntryInfo->propagateTimer = scheduler::schedule(deferNext,
     bind(&NccStrategy::doPropagate, this,
          weak_ptr<pit::Entry>(pitEntry), weak_ptr<fib::Entry>(fibEntry)));
   }
@@ -172,9 +174,10 @@
     measurementsEntry = this->getMeasurements().getParent(measurementsEntry);
   }
 
-  shared_ptr<PitEntryInfo> pitEntryInfo =
-    pitEntry->getStrategyInfo<PitEntryInfo>();
-  scheduler::cancel(pitEntryInfo->m_propagateTimer);
+  shared_ptr<PitEntryInfo> pitEntryInfo = pitEntry->getStrategyInfo<PitEntryInfo>();
+  if (static_cast<bool>(pitEntryInfo)) {
+    scheduler::cancel(pitEntryInfo->propagateTimer);
+  }
 }
 
 shared_ptr<NccStrategy::MeasurementsEntryInfo>
@@ -206,15 +209,15 @@
 }
 
 
-const time::nanoseconds NccStrategy::MeasurementsEntryInfo::INITIAL_PREDICTION =
-                                                         time::microseconds(8192);
-const time::nanoseconds NccStrategy::MeasurementsEntryInfo::MIN_PREDICTION =
-                                                         time::microseconds(127);
-const time::nanoseconds NccStrategy::MeasurementsEntryInfo::MAX_PREDICTION =
-                                                         time::microseconds(160000);
+const time::microseconds NccStrategy::MeasurementsEntryInfo::INITIAL_PREDICTION =
+                                                             time::microseconds(8192);
+const time::microseconds NccStrategy::MeasurementsEntryInfo::MIN_PREDICTION =
+                                                             time::microseconds(127);
+const time::microseconds NccStrategy::MeasurementsEntryInfo::MAX_PREDICTION =
+                                                             time::microseconds(160000);
 
 NccStrategy::MeasurementsEntryInfo::MeasurementsEntryInfo()
-  : m_prediction(INITIAL_PREDICTION)
+  : prediction(INITIAL_PREDICTION)
 {
 }
 
@@ -226,57 +229,57 @@
 
 shared_ptr<Face>
 NccStrategy::MeasurementsEntryInfo::getBestFace(void) {
-  shared_ptr<Face> best = m_bestFace.lock();
+  shared_ptr<Face> best = this->bestFace.lock();
   if (static_cast<bool>(best)) {
     return best;
   }
-  m_bestFace = best = m_previousFace.lock();
+  this->bestFace = best = this->previousFace.lock();
   return best;
 }
 
 void
 NccStrategy::MeasurementsEntryInfo::updateBestFace(const Face& face) {
-  if (m_bestFace.expired()) {
-    m_bestFace = const_cast<Face&>(face).shared_from_this();
+  if (this->bestFace.expired()) {
+    this->bestFace = const_cast<Face&>(face).shared_from_this();
     return;
   }
-  shared_ptr<Face> bestFace = m_bestFace.lock();
+  shared_ptr<Face> bestFace = this->bestFace.lock();
   if (bestFace.get() == &face) {
     this->adjustPredictDown();
   }
   else {
-    m_previousFace = m_bestFace;
-    m_bestFace = const_cast<Face&>(face).shared_from_this();
+    this->previousFace = this->bestFace;
+    this->bestFace = const_cast<Face&>(face).shared_from_this();
   }
 }
 
 void
 NccStrategy::MeasurementsEntryInfo::adjustPredictDown() {
-  m_prediction = std::max(MIN_PREDICTION,
-    time::nanoseconds(m_prediction.count() - (m_prediction.count() >> ADJUST_PREDICT_DOWN_SHIFT)));
+  prediction = std::max(MIN_PREDICTION,
+    time::microseconds(prediction.count() - (prediction.count() >> ADJUST_PREDICT_DOWN_SHIFT)));
 }
 
 void
 NccStrategy::MeasurementsEntryInfo::adjustPredictUp() {
-  m_prediction = std::min(MAX_PREDICTION,
-    time::nanoseconds(m_prediction.count() + (m_prediction.count() >> ADJUST_PREDICT_UP_SHIFT)));
+  prediction = std::min(MAX_PREDICTION,
+    time::microseconds(prediction.count() + (prediction.count() >> ADJUST_PREDICT_UP_SHIFT)));
 }
 
 void
 NccStrategy::MeasurementsEntryInfo::ageBestFace() {
-  m_previousFace = m_bestFace;
-  m_bestFace.reset();
+  this->previousFace = this->bestFace;
+  this->bestFace.reset();
 }
 
 NccStrategy::PitEntryInfo::PitEntryInfo()
-  : m_isNewInterest(true)
+  : isNewInterest(true)
 {
 }
 
 NccStrategy::PitEntryInfo::~PitEntryInfo()
 {
-  scheduler::cancel(m_bestFaceTimeout);
-  scheduler::cancel(m_propagateTimer);
+  scheduler::cancel(this->bestFaceTimeout);
+  scheduler::cancel(this->propagateTimer);
 }
 
 } // namespace fw
diff --git a/daemon/fw/ncc-strategy.hpp b/daemon/fw/ncc-strategy.hpp
index 6a41b1a..1b073a9 100644
--- a/daemon/fw/ncc-strategy.hpp
+++ b/daemon/fw/ncc-strategy.hpp
@@ -59,14 +59,14 @@
     ageBestFace();
 
   public:
-    weak_ptr<Face> m_bestFace;
-    weak_ptr<Face> m_previousFace;
-    time::nanoseconds m_prediction;
+    weak_ptr<Face> bestFace;
+    weak_ptr<Face> previousFace;
+    time::microseconds prediction;
 
-    static const time::nanoseconds INITIAL_PREDICTION;
-    static const time::nanoseconds MIN_PREDICTION;
+    static const time::microseconds INITIAL_PREDICTION;
+    static const time::microseconds MIN_PREDICTION;
     static const int ADJUST_PREDICT_DOWN_SHIFT = 7;
-    static const time::nanoseconds MAX_PREDICTION;
+    static const time::microseconds MAX_PREDICTION;
     static const int ADJUST_PREDICT_UP_SHIFT = 3;
   };
 
@@ -80,10 +80,10 @@
     ~PitEntryInfo();
 
   public:
-    bool m_isNewInterest;
-    EventId m_bestFaceTimeout;
-    EventId m_propagateTimer;
-    time::nanoseconds m_maxInterval;
+    bool isNewInterest;
+    EventId bestFaceTimeout;
+    EventId propagateTimer;
+    time::microseconds maxInterval;
   };
 
 protected:
@@ -105,8 +105,8 @@
   static const Name STRATEGY_NAME;
 
 protected:
-  static const time::nanoseconds DEFER_FIRST_WITHOUT_BEST_FACE;
-  static const time::nanoseconds DEFER_RANGE_WITHOUT_BEST_FACE;
+  static const time::microseconds DEFER_FIRST_WITHOUT_BEST_FACE;
+  static const time::microseconds DEFER_RANGE_WITHOUT_BEST_FACE;
   static const int UPDATE_MEASUREMENTS_N_LEVELS = 2;
   static const time::nanoseconds MEASUREMENTS_LIFETIME;
 };
