diff --git a/tests/unit/detail/cancel-handle.t.cpp b/tests/unit/detail/cancel-handle.t.cpp
index b87f9cd..2e951dd 100644
--- a/tests/unit/detail/cancel-handle.t.cpp
+++ b/tests/unit/detail/cancel-handle.t.cpp
@@ -55,11 +55,13 @@
 
 BOOST_AUTO_TEST_SUITE(ScopedHandle)
 
+using ScopedTestHandle = ScopedCancelHandle<CancelHandle>;
+
 BOOST_AUTO_TEST_CASE(ManualCancel)
 {
   int nCancels = 0;
   {
-    ScopedCancelHandle hdl = makeDummyCancelHandle(nCancels);
+    ScopedTestHandle hdl = makeDummyCancelHandle(nCancels);
     BOOST_CHECK_EQUAL(nCancels, 0);
 
     hdl.cancel();
@@ -72,7 +74,7 @@
 {
   int nCancels = 0;
   {
-    ScopedCancelHandle hdl = makeDummyCancelHandle(nCancels);
+    ScopedTestHandle hdl = makeDummyCancelHandle(nCancels);
     BOOST_CHECK_EQUAL(nCancels, 0);
   } // hdl goes out of scope
   BOOST_CHECK_EQUAL(nCancels, 1);
@@ -82,7 +84,7 @@
 {
   int nCancels1 = 0, nCancels2 = 0;
   {
-    ScopedCancelHandle hdl = makeDummyCancelHandle(nCancels1);
+    ScopedTestHandle hdl = makeDummyCancelHandle(nCancels1);
     hdl = makeDummyCancelHandle(nCancels2);
     BOOST_CHECK_EQUAL(nCancels1, 1);
     BOOST_CHECK_EQUAL(nCancels2, 0);
@@ -94,7 +96,7 @@
 {
   int nCancels = 0;
   {
-    ScopedCancelHandle hdl = makeDummyCancelHandle(nCancels);
+    ScopedTestHandle hdl = makeDummyCancelHandle(nCancels);
     hdl.release();
     hdl.cancel(); // no effect
   } // hdl goes out of scope
@@ -104,10 +106,10 @@
 BOOST_AUTO_TEST_CASE(MoveConstruct)
 {
   int nCancels = 0;
-  unique_ptr<ScopedCancelHandle> hdl1;
+  unique_ptr<ScopedTestHandle> hdl1;
   {
-    ScopedCancelHandle hdl2 = makeDummyCancelHandle(nCancels);
-    hdl1 = make_unique<ScopedCancelHandle>(std::move(hdl2));
+    ScopedTestHandle hdl2 = makeDummyCancelHandle(nCancels);
+    hdl1 = make_unique<ScopedTestHandle>(std::move(hdl2));
   } // hdl2 goes out of scope
   BOOST_CHECK_EQUAL(nCancels, 0);
   hdl1.reset();
@@ -118,9 +120,9 @@
 {
   int nCancels = 0;
   {
-    ScopedCancelHandle hdl1;
+    ScopedTestHandle hdl1;
     {
-      ScopedCancelHandle hdl2 = makeDummyCancelHandle(nCancels);
+      ScopedTestHandle hdl2 = makeDummyCancelHandle(nCancels);
       hdl1 = std::move(hdl2);
     } // hdl2 goes out of scope
     BOOST_CHECK_EQUAL(nCancels, 0);
diff --git a/tests/unit/face.t.cpp b/tests/unit/face.t.cpp
index 43b4db5..eb01f8f 100644
--- a/tests/unit/face.t.cpp
+++ b/tests/unit/face.t.cpp
@@ -267,25 +267,6 @@
   } while (false));
 }
 
-BOOST_AUTO_TEST_CASE(RemovePendingInterestId)
-{
-  const PendingInterestId* interestId =
-    face.expressInterest(*makeInterest("/Hello/World", true, 50_ms),
-                         bind([] { BOOST_FAIL("Unexpected data"); }),
-                         bind([] { BOOST_FAIL("Unexpected nack"); }),
-                         bind([] { BOOST_FAIL("Unexpected timeout"); }));
-  advanceClocks(10_ms);
-
-  face.removePendingInterest(interestId);
-  advanceClocks(10_ms);
-
-  face.receive(*makeData("/Hello/World/%21"));
-  advanceClocks(200_ms, 5);
-
-  // avoid "test case [...] did not check any assertions" message from Boost.Test
-  BOOST_CHECK(true);
-}
-
 BOOST_AUTO_TEST_CASE(CancelPendingInterestHandle)
 {
   auto hdl = face.expressInterest(*makeInterest("/Hello/World", true, 50_ms),
@@ -391,7 +372,7 @@
   bool hasInterest1 = false, hasData = false;
 
   // first InterestFilter allows loopback and should receive Interest
-  face.setInterestFilter("/", [&] (const InterestFilter&, const Interest& interest) {
+  face.setInterestFilter("/", [&] (const InterestFilter&, const Interest&) {
     hasInterest1 = true;
     // do not respond with Data right away, so Face must send Interest to forwarder
   });
@@ -534,11 +515,10 @@
 {
   size_t nInterests = 0;
   size_t nRegs = 0;
-  const RegisteredPrefixId* regPrefixId =
-    face.setInterestFilter("/Hello/World",
-                           bind([&nInterests] { ++nInterests; }),
-                           bind([&nRegs] { ++nRegs; }),
-                           bind([] {  BOOST_FAIL("Unexpected setInterestFilter failure"); }));
+  auto hdl = face.setInterestFilter("/Hello/World",
+                                    bind([&nInterests] { ++nInterests; }),
+                                    bind([&nRegs] { ++nRegs; }),
+                                    bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
   advanceClocks(25_ms, 4);
   BOOST_CHECK_EQUAL(nRegs, 1);
   BOOST_CHECK_EQUAL(nInterests, 0);
@@ -558,7 +538,7 @@
   BOOST_CHECK_EQUAL(nInterests, 2);
 
   // removing filter
-  face.unsetInterestFilter(regPrefixId);
+  hdl.cancel();
   advanceClocks(25_ms, 4);
 
   face.receive(*makeInterest("/Hello/World/%21/3"));
@@ -585,10 +565,9 @@
 BOOST_AUTO_TEST_CASE(SetUnsetInterestFilterWithoutSucessCallback)
 {
   size_t nInterests = 0;
-  const RegisteredPrefixId* regPrefixId =
-    face.setInterestFilter("/Hello/World",
-                           bind([&nInterests] { ++nInterests; }),
-                           bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
+  auto hdl = face.setInterestFilter("/Hello/World",
+                                    bind([&nInterests] { ++nInterests; }),
+                                    bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
   advanceClocks(25_ms, 4);
   BOOST_CHECK_EQUAL(nInterests, 0);
 
@@ -606,7 +585,7 @@
   BOOST_CHECK_EQUAL(nInterests, 2);
 
   // removing filter
-  face.unsetInterestFilter(regPrefixId);
+  hdl.cancel();
   advanceClocks(25_ms, 4);
 
   face.receive(*makeInterest("/Hello/World/%21/3"));
@@ -650,18 +629,6 @@
   BOOST_CHECK_EQUAL(nRegFailed, 1);
 }
 
-BOOST_AUTO_TEST_CASE(RegisterUnregisterPrefixFunc)
-{
-  const RegisteredPrefixId* regPrefixId = nullptr;
-  BOOST_CHECK(runPrefixReg([&] (const auto& success, const auto& failure) {
-    regPrefixId = face.registerPrefix("/Hello/World", success, failure);
-  }));
-
-  BOOST_CHECK(runPrefixUnreg([&] (const auto& success, const auto& failure) {
-    face.unregisterPrefix(regPrefixId, success, failure);
-  }));
-}
-
 BOOST_FIXTURE_TEST_CASE(RegisterUnregisterPrefixFail, FaceFixture<NoPrefixRegReply>)
 {
   BOOST_CHECK(!runPrefixReg([&] (const auto& success, const auto& failure) {
diff --git a/tests/unit/util/scheduler.t.cpp b/tests/unit/util/scheduler.t.cpp
index d403a7c..021c1f0 100644
--- a/tests/unit/util/scheduler.t.cpp
+++ b/tests/unit/util/scheduler.t.cpp
@@ -249,7 +249,7 @@
   BOOST_CHECK(eid == EventId{});
 }
 
-BOOST_AUTO_TEST_CASE(Valid)
+BOOST_AUTO_TEST_CASE(OperatorBool)
 {
   EventId eid;
   BOOST_CHECK_EQUAL(static_cast<bool>(eid), false);
@@ -366,6 +366,26 @@
   BOOST_CHECK_EQUAL(hit, 2);
 }
 
+BOOST_AUTO_TEST_CASE(OperatorBool)
+{
+  ScopedEventId se;
+  BOOST_CHECK_EQUAL(static_cast<bool>(se), false);
+  BOOST_CHECK_EQUAL(!se, true);
+
+  se = scheduler.schedule(10_ms, []{});
+  BOOST_CHECK_EQUAL(static_cast<bool>(se), true);
+  BOOST_CHECK_EQUAL(!se, false);
+
+  se.cancel();
+  BOOST_CHECK(!se);
+
+  se = scheduler.schedule(10_ms, []{});
+  BOOST_CHECK(se);
+
+  se.release();
+  BOOST_CHECK(!se);
+}
+
 BOOST_AUTO_TEST_SUITE_END() // ScopedEventId
 
 BOOST_AUTO_TEST_SUITE_END() // TestScheduler
