diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2946414..4e12850 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,22 +1,13 @@
 
 LDADD = ../libndn-cpp.la
 
-# Temporary disabled (need fixing)
-#
-# noinst_PROGRAMS = test-encode-decode-benchmark \
-# 	test-encode-decode-data \
-# 	test-encode-decode-forwarding-entry \
-# 	test-encode-decode-interest \
-# 	test-get-async \
-# 	test-publish-async
+noinst_PROGRAMS = \
+	test-get-async \
+	test-publish-async
 
-test_encode_decode_benchmark_SOURCES = test-encode-decode-benchmark.cpp
+# test-encode-decode-benchmark
 
-test_encode_decode_data_SOURCES = test-encode-decode-data.cpp
-
-test_encode_decode_forwarding_entry_SOURCES = test-encode-decode-forwarding-entry.cpp
-
-test_encode_decode_interest_SOURCES = test-encode-decode-interest.cpp
+# test_encode_decode_benchmark_SOURCES = test-encode-decode-benchmark.cpp
 
 test_get_async_SOURCES = test-get-async.cpp
 
diff --git a/tests/test-encode-decode-benchmark.cpp b/tests/test-encode-decode-benchmark.cpp
index 344a02f..0aa48d3 100644
--- a/tests/test-encode-decode-benchmark.cpp
+++ b/tests/test-encode-decode-benchmark.cpp
@@ -11,12 +11,11 @@
 #include <sstream>
 #include <stdexcept>
 #include <ndn-cpp/data.hpp>
-#include <ndn-cpp/sha256-with-rsa-signature.hpp>
-#include <ndn-cpp/key-locator.hpp>
 #include <ndn-cpp/security/key-chain.hpp>
 #include <ndn-cpp/security/identity/memory-identity-storage.hpp>
 #include <ndn-cpp/security/identity/memory-private-key-storage.hpp>
 #include <ndn-cpp/security/policy/self-verify-policy-manager.hpp>
+
 // Hack: Hook directly into non-API functions.
 #include "../src/c/encoding/binary-xml-decoder.h"
 #include "../src/c/data.h"
@@ -215,12 +214,12 @@
 {
   // Initialize the KeyChain storage in case useCrypto is true.
   ptr_lib::shared_ptr<MemoryIdentityStorage> identityStorage(new MemoryIdentityStorage());
-  ptr_lib::shared_ptr<MemoryPrivateKeyStorage> privateKeyStorage(new MemoryPrivateKeyStorage());
-  KeyChain keyChain
-    (ptr_lib::make_shared<IdentityManager>(identityStorage, privateKeyStorage), 
-     ptr_lib::make_shared<SelfVerifyPolicyManager>(identityStorage.get()));
-  Name keyName("/testname/DSK-123");
   identityStorage->addKey(keyName, KEY_TYPE_RSA, Blob(DEFAULT_PUBLIC_KEY_DER, sizeof(DEFAULT_PUBLIC_KEY_DER)));
+  
+  ptr_lib::shared_ptr<MemoryPrivateKeyStorage> privateKeyStorage(new MemoryPrivateKeyStorage());
+  KeyChain keyChain(identityStorage, privateKeyStorage);
+  
+  Name keyName("/testname/DSK-123");
 
   size_t nameSize = 0;
   double start = getNowSeconds();
diff --git a/tests/test-encode-decode-data.cpp b/tests/test-encode-decode-data.cpp
deleted file mode 100644
index 41fefcd..0000000
--- a/tests/test-encode-decode-data.cpp
+++ /dev/null
@@ -1,263 +0,0 @@
-/**
- * Copyright (C) 2013 Regents of the University of California.
- * @author: Jeff Thompson <jefft0@remap.ucla.edu>
- * See COPYING for copyright and distribution information.
- */
-
-#include <cstdlib>
-#include <sstream>
-#include <iostream>
-#include <time.h>
-#include <stdint.h>
-#include <ndn-cpp/data.hpp>
-#include <ndn-cpp/security/identity/memory-identity-storage.hpp>
-#include <ndn-cpp/security/identity/memory-private-key-storage.hpp>
-#include <ndn-cpp/security/policy/self-verify-policy-manager.hpp>
-#include <ndn-cpp/security/key-chain.hpp>
-#include <ndn-cpp/sha256-with-rsa-signature.hpp>
-
-using namespace std;
-using namespace ndn;
-using namespace ndn::func_lib;
-#if NDN_CPP_HAVE_STD_FUNCTION
-// In the std library, the placeholders are in a different namespace than boost.                                                           
-using namespace func_lib::placeholders;
-#endif
-
-static uint8_t DEFAULT_PUBLIC_KEY_DER[] = {
-0x30, 0x81, 0x9F, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81,
-0x8D, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xE1, 0x7D, 0x30, 0xA7, 0xD8, 0x28, 0xAB, 0x1B, 0x84, 0x0B, 0x17,
-0x54, 0x2D, 0xCA, 0xF6, 0x20, 0x7A, 0xFD, 0x22, 0x1E, 0x08, 0x6B, 0x2A, 0x60, 0xD1, 0x6C, 0xB7, 0xF5, 0x44, 0x48, 0xBA,
-0x9F, 0x3F, 0x08, 0xBC, 0xD0, 0x99, 0xDB, 0x21, 0xDD, 0x16, 0x2A, 0x77, 0x9E, 0x61, 0xAA, 0x89, 0xEE, 0xE5, 0x54, 0xD3,
-0xA4, 0x7D, 0xE2, 0x30, 0xBC, 0x7A, 0xC5, 0x90, 0xD5, 0x24, 0x06, 0x7C, 0x38, 0x98, 0xBB, 0xA6, 0xF5, 0xDC, 0x43, 0x60,
-0xB8, 0x45, 0xED, 0xA4, 0x8C, 0xBD, 0x9C, 0xF1, 0x26, 0xA7, 0x23, 0x44, 0x5F, 0x0E, 0x19, 0x52, 0xD7, 0x32, 0x5A, 0x75,
-0xFA, 0xF5, 0x56, 0x14, 0x4F, 0x9A, 0x98, 0xAF, 0x71, 0x86, 0xB0, 0x27, 0x86, 0x85, 0xB8, 0xE2, 0xC0, 0x8B, 0xEA, 0x87,
-0x17, 0x1B, 0x4D, 0xEE, 0x58, 0x5C, 0x18, 0x28, 0x29, 0x5B, 0x53, 0x95, 0xEB, 0x4A, 0x17, 0x77, 0x9F, 0x02, 0x03, 0x01,
-0x00, 01  
-};
-
-static uint8_t DEFAULT_PRIVATE_KEY_DER[] = {
-0x30, 0x82, 0x02, 0x5d, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0xe1, 0x7d, 0x30, 0xa7, 0xd8, 0x28, 0xab, 0x1b, 0x84,
-0x0b, 0x17, 0x54, 0x2d, 0xca, 0xf6, 0x20, 0x7a, 0xfd, 0x22, 0x1e, 0x08, 0x6b, 0x2a, 0x60, 0xd1, 0x6c, 0xb7, 0xf5, 0x44,
-0x48, 0xba, 0x9f, 0x3f, 0x08, 0xbc, 0xd0, 0x99, 0xdb, 0x21, 0xdd, 0x16, 0x2a, 0x77, 0x9e, 0x61, 0xaa, 0x89, 0xee, 0xe5,
-0x54, 0xd3, 0xa4, 0x7d, 0xe2, 0x30, 0xbc, 0x7a, 0xc5, 0x90, 0xd5, 0x24, 0x06, 0x7c, 0x38, 0x98, 0xbb, 0xa6, 0xf5, 0xdc,
-0x43, 0x60, 0xb8, 0x45, 0xed, 0xa4, 0x8c, 0xbd, 0x9c, 0xf1, 0x26, 0xa7, 0x23, 0x44, 0x5f, 0x0e, 0x19, 0x52, 0xd7, 0x32,
-0x5a, 0x75, 0xfa, 0xf5, 0x56, 0x14, 0x4f, 0x9a, 0x98, 0xaf, 0x71, 0x86, 0xb0, 0x27, 0x86, 0x85, 0xb8, 0xe2, 0xc0, 0x8b,
-0xea, 0x87, 0x17, 0x1b, 0x4d, 0xee, 0x58, 0x5c, 0x18, 0x28, 0x29, 0x5b, 0x53, 0x95, 0xeb, 0x4a, 0x17, 0x77, 0x9f, 0x02,
-0x03, 0x01, 0x00, 0x01, 0x02, 0x81, 0x80, 0x1a, 0x4b, 0xfa, 0x4f, 0xa8, 0xc2, 0xdd, 0x69, 0xa1, 0x15, 0x96, 0x0b, 0xe8,
-0x27, 0x42, 0x5a, 0xf9, 0x5c, 0xea, 0x0c, 0xac, 0x98, 0xaa, 0xe1, 0x8d, 0xaa, 0xeb, 0x2d, 0x3c, 0x60, 0x6a, 0xfb, 0x45,
-0x63, 0xa4, 0x79, 0x83, 0x67, 0xed, 0xe4, 0x15, 0xc0, 0xb0, 0x20, 0x95, 0x6d, 0x49, 0x16, 0xc6, 0x42, 0x05, 0x48, 0xaa,
-0xb1, 0xa5, 0x53, 0x65, 0xd2, 0x02, 0x99, 0x08, 0xd1, 0x84, 0xcc, 0xf0, 0xcd, 0xea, 0x61, 0xc9, 0x39, 0x02, 0x3f, 0x87,
-0x4a, 0xe5, 0xc4, 0xd2, 0x07, 0x02, 0xe1, 0x9f, 0xa0, 0x06, 0xc2, 0xcc, 0x02, 0xe7, 0xaa, 0x6c, 0x99, 0x8a, 0xf8, 0x49,
-0x00, 0xf1, 0xa2, 0x8c, 0x0c, 0x8a, 0xb9, 0x4f, 0x6d, 0x73, 0x3b, 0x2c, 0xb7, 0x9f, 0x8a, 0xa6, 0x7f, 0x9b, 0x9f, 0xb7,
-0xa1, 0xcc, 0x74, 0x2e, 0x8f, 0xb8, 0xb0, 0x26, 0x89, 0xd2, 0xe5, 0x66, 0xe8, 0x8e, 0xa1, 0x02, 0x41, 0x00, 0xfc, 0xe7,
-0x52, 0xbc, 0x4e, 0x95, 0xb6, 0x1a, 0xb4, 0x62, 0xcc, 0xd8, 0x06, 0xe1, 0xdc, 0x7a, 0xa2, 0xb6, 0x71, 0x01, 0xaa, 0x27,
-0xfc, 0x99, 0xe5, 0xf2, 0x54, 0xbb, 0xb2, 0x85, 0xe1, 0x96, 0x54, 0x2d, 0xcb, 0xba, 0x86, 0xfa, 0x80, 0xdf, 0xcf, 0x39,
-0xe6, 0x74, 0xcb, 0x22, 0xce, 0x70, 0xaa, 0x10, 0x00, 0x73, 0x1d, 0x45, 0x0a, 0x39, 0x51, 0x84, 0xf5, 0x15, 0x8f, 0x37,
-0x76, 0x91, 0x02, 0x41, 0x00, 0xe4, 0x3f, 0xf0, 0xf4, 0xde, 0x79, 0x77, 0x48, 0x9b, 0x9c, 0x28, 0x45, 0x26, 0x57, 0x3c,
-0x71, 0x40, 0x28, 0x6a, 0xa1, 0xfe, 0xc3, 0xe5, 0x37, 0xa1, 0x03, 0xf6, 0x2d, 0xbe, 0x80, 0x64, 0x72, 0x69, 0x2e, 0x9b,
-0x4d, 0xe3, 0x2e, 0x1b, 0xfe, 0xe7, 0xf9, 0x77, 0x8c, 0x18, 0x53, 0x9f, 0xe2, 0xfe, 0x00, 0xbb, 0x49, 0x20, 0x47, 0xdf,
-0x01, 0x61, 0x87, 0xd6, 0xe3, 0x44, 0xb5, 0x03, 0x2f, 0x02, 0x40, 0x54, 0xec, 0x7c, 0xbc, 0xdd, 0x0a, 0xaa, 0xde, 0xe6,
-0xc9, 0xf2, 0x8d, 0x6c, 0x2a, 0x35, 0xf6, 0x3c, 0x63, 0x55, 0x29, 0x40, 0xf1, 0x32, 0x82, 0x9f, 0x53, 0xb3, 0x9e, 0x5f,
-0xc1, 0x53, 0x52, 0x3e, 0xac, 0x2e, 0x28, 0x51, 0xa1, 0x16, 0xdb, 0x90, 0xe3, 0x99, 0x7e, 0x88, 0xa4, 0x04, 0x7c, 0x92,
-0xae, 0xd2, 0xe7, 0xd4, 0xe1, 0x55, 0x20, 0x90, 0x3e, 0x3c, 0x6a, 0x63, 0xf0, 0x34, 0xf1, 0x02, 0x41, 0x00, 0x84, 0x5a,
-0x17, 0x6c, 0xc6, 0x3c, 0x84, 0xd0, 0x93, 0x7a, 0xff, 0x56, 0xe9, 0x9e, 0x98, 0x2b, 0xcb, 0x5a, 0x24, 0x4a, 0xff, 0x21,
-0xb4, 0x9e, 0x87, 0x3d, 0x76, 0xd8, 0x9b, 0xa8, 0x73, 0x96, 0x6c, 0x2b, 0x5c, 0x5e, 0xd3, 0xa6, 0xff, 0x10, 0xd6, 0x8e,
-0xaf, 0xa5, 0x8a, 0xcd, 0xa2, 0xde, 0xcb, 0x0e, 0xbd, 0x8a, 0xef, 0xae, 0xfd, 0x3f, 0x1d, 0xc0, 0xd8, 0xf8, 0x3b, 0xf5,
-0x02, 0x7d, 0x02, 0x41, 0x00, 0x8b, 0x26, 0xd3, 0x2c, 0x7d, 0x28, 0x38, 0x92, 0xf1, 0xbf, 0x15, 0x16, 0x39, 0x50, 0xc8,
-0x6d, 0x32, 0xec, 0x28, 0xf2, 0x8b, 0xd8, 0x70, 0xc5, 0xed, 0xe1, 0x7b, 0xff, 0x2d, 0x66, 0x8c, 0x86, 0x77, 0x43, 0xeb,
-0xb6, 0xf6, 0x50, 0x66, 0xb0, 0x40, 0x24, 0x6a, 0xaf, 0x98, 0x21, 0x45, 0x30, 0x01, 0x59, 0xd0, 0xc3, 0xfc, 0x7b, 0xae,
-0x30, 0x18, 0xeb, 0x90, 0xfb, 0x17, 0xd3, 0xce, 0xb5
-};
-
-uint8_t Data1[] = {
-0x04, 0x82, // NDN Data
-  0x02, 0xaa, // Signature
-    0x03, 0xb2, // SignatureBits
-      0x08, 0x85, 0x20, 0xea, 0xb5, 0xb0, 0x63, 0xda, 0x94, 0xe9, 0x68, 0x7a,
-      0x8e, 0x65, 0x60, 0xe0, 0xc6, 0x43, 0x96, 0xd9, 0x69, 0xb4, 0x40, 0x72, 0x52, 0x00, 0x2c, 0x8e, 0x2a, 0xf5,
-      0x47, 0x12, 0x59, 0x93, 0xda, 0xed, 0x82, 0xd0, 0xf8, 0xe6, 0x65, 0x09, 0x87, 0x84, 0x54, 0xc7, 0xce, 0x9a,
-      0x93, 0x0d, 0x47, 0xf1, 0xf9, 0x3b, 0x98, 0x78, 0x2c, 0x22, 0x21, 0xd9, 0x2b, 0xda, 0x03, 0x30, 0x84, 0xf3,
-      0xc5, 0x52, 0x64, 0x2b, 0x1d, 0xde, 0x50, 0xe0, 0xee, 0xca, 0xa2, 0x73, 0x7a, 0x93, 0x30, 0xa8, 0x47, 0x7f,
-      0x6f, 0x41, 0xb0, 0xc8, 0x6e, 0x89, 0x1c, 0xcc, 0xf9, 0x01, 0x44, 0xc3, 0x08, 0xcf, 0x77, 0x47, 0xfc, 0xed,
-      0x48, 0xf0, 0x4c, 0xe9, 0xc2, 0x3b, 0x7d, 0xef, 0x6e, 0xa4, 0x80, 0x40, 0x9e, 0x43, 0xb6, 0x77, 0x7a, 0x1d,
-      0x51, 0xed, 0x98, 0x33, 0x93, 0xdd, 0x88, 0x01, 0x0e, 0xd3, 
-    0x00, 
-  0x00, 
-  0xf2, 0xfa, 0x9d, 0x6e, 0x64, 0x6e, 0x00, 0xfa, 0x9d, 0x61, 0x62, 0x63, 0x00, 0x00,  // Name
-  0x01, 0xa2, // SignedInfo
-    0x03, 0xe2, // PublisherPublicKeyDigest
-      0x02, 0x85, 0xb5, 0x50, 0x6b, 0x1a,
-      0xba, 0x3d, 0xa7, 0x76, 0x1b, 0x0f, 0x8d, 0x61, 0xa4, 0xaa, 0x7e, 0x3b, 0x6d, 0x15, 0xb4, 0x26, 0xfe, 0xb5,
-      0xbd, 0xa8, 0x23, 0x89, 0xac, 0xa7, 0x65, 0xa3, 0xb8, 0x1c, 
-    0x00, 
-    0x02, 0xba, // Timestamp
-      0xb5, 0x05, 0x1d, 0xde, 0xe9, 0x5b, 0xdb, 
-    0x00, 
-    0x01, 0xe2, // KeyLocator
-      0x01, 0xda, // Key
-        0x0a, 0x95, 0x30, 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86,
-        0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81,
-        0x81, 0x00, 0xe1, 0x7d, 0x30, 0xa7, 0xd8, 0x28, 0xab, 0x1b, 0x84, 0x0b, 0x17, 0x54, 0x2d, 0xca, 0xf6, 0x20,
-        0x7a, 0xfd, 0x22, 0x1e, 0x08, 0x6b, 0x2a, 0x60, 0xd1, 0x6c, 0xb7, 0xf5, 0x44, 0x48, 0xba, 0x9f, 0x3f, 0x08,
-        0xbc, 0xd0, 0x99, 0xdb, 0x21, 0xdd, 0x16, 0x2a, 0x77, 0x9e, 0x61, 0xaa, 0x89, 0xee, 0xe5, 0x54, 0xd3, 0xa4,
-        0x7d, 0xe2, 0x30, 0xbc, 0x7a, 0xc5, 0x90, 0xd5, 0x24, 0x06, 0x7c, 0x38, 0x98, 0xbb, 0xa6, 0xf5, 0xdc, 0x43,
-        0x60, 0xb8, 0x45, 0xed, 0xa4, 0x8c, 0xbd, 0x9c, 0xf1, 0x26, 0xa7, 0x23, 0x44, 0x5f, 0x0e, 0x19, 0x52, 0xd7,
-        0x32, 0x5a, 0x75, 0xfa, 0xf5, 0x56, 0x14, 0x4f, 0x9a, 0x98, 0xaf, 0x71, 0x86, 0xb0, 0x27, 0x86, 0x85, 0xb8,
-        0xe2, 0xc0, 0x8b, 0xea, 0x87, 0x17, 0x1b, 0x4d, 0xee, 0x58, 0x5c, 0x18, 0x28, 0x29, 0x5b, 0x53, 0x95, 0xeb,
-        0x4a, 0x17, 0x77, 0x9f, 0x02, 0x03, 0x01, 0x00, 0x01, 
-      0x00, 
-    0x00, 
-  0x00, 
-  0x01, 0x9a, // Content
-    0xc5, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x21, 
-  0x00, 
-0x00,
-1
-};
-
-static void dumpData(const Data& data)
-{
-  cout << "name: " << data.getName().to_uri() << endl;
-  if (data.getContent().size() > 0) {
-    cout << "content (raw): ";
-    for (size_t i = 0; i < data.getContent().size(); ++i)
-      cout << (*data.getContent())[i];
-    cout<< endl;
-    cout << "content (hex): " << toHex(*data.getContent()) << endl;
-  }
-  else
-    cout << "content: <empty>" << endl;
-  
-  cout << "metaInfo.timestamp: ";
-  if (data.getMetaInfo().getTimestampMilliseconds() >= 0) {
-    time_t seconds = data.getMetaInfo().getTimestampMilliseconds() / 1000.0;
-    cout << data.getMetaInfo().getTimestampMilliseconds() << " milliseconds, UTC time: " << asctime(gmtime(&seconds));
-  }
-  else
-    cout << "<none>" << endl;
-  if (!(data.getMetaInfo().getType() < 0 || data.getMetaInfo().getType() == ndn_ContentType_DATA)) {
-    cout << "metaInfo.type: ";
-    if (data.getMetaInfo().getType() == ndn_ContentType_ENCR)
-      cout << "ENCR" << endl;
-    else if (data.getMetaInfo().getType() == ndn_ContentType_GONE)
-      cout << "GONE" << endl;
-    else if (data.getMetaInfo().getType() == ndn_ContentType_KEY)
-      cout << "KEY" << endl;
-    else if (data.getMetaInfo().getType() == ndn_ContentType_LINK)
-      cout << "LINK" << endl;
-    else if (data.getMetaInfo().getType() == ndn_ContentType_NACK)
-      cout << "NACK" << endl;
-  }
-  cout << "metaInfo.freshnessSeconds: ";
-  if (data.getMetaInfo().getFreshnessSeconds() >= 0)
-    cout << data.getMetaInfo().getFreshnessSeconds() << endl;
-  else
-    cout << "<none>" << endl;
-  cout << "metaInfo.finalBlockID: "
-       << (data.getMetaInfo().getFinalBlockID().getValue().size() > 0 ? 
-           toHex(*data.getMetaInfo().getFinalBlockID().getValue()).c_str() : "<none>") << endl;
-    
-  const Sha256WithRsaSignature *signature = dynamic_cast<const Sha256WithRsaSignature*>(data.getSignature());
-  if (signature) {
-    cout << "signature.digestAlgorithm: "
-         << (signature->getDigestAlgorithm().size() > 0 ? toHex(*signature->getDigestAlgorithm()).c_str() : "default (sha-256)") << endl;
-    cout << "signature.witness: "
-         << (signature->getWitness().size() > 0 ? toHex(*signature->getWitness()).c_str() : "<none>") << endl;
-    cout << "signature.signature: "
-         << (signature->getSignature().size() > 0 ? toHex(*signature->getSignature()).c_str() : "<none>") << endl;
-    cout << "signature.publisherPublicKeyDigest: "
-         << (signature->getPublisherPublicKeyDigest().getPublisherPublicKeyDigest().size() > 0 ? 
-           toHex(*signature->getPublisherPublicKeyDigest().getPublisherPublicKeyDigest()).c_str() : "<none>") << endl;
-    cout << "signature.keyLocator: ";
-    if ((int)signature->getKeyLocator().getType() >= 0) {
-      if (signature->getKeyLocator().getType() == ndn_KeyLocatorType_KEY)
-        cout << "Key: " << toHex(*signature->getKeyLocator().getKeyData()) << endl;
-      else if (signature->getKeyLocator().getType() == ndn_KeyLocatorType_CERTIFICATE)
-        cout << "Certificate: " << toHex(*signature->getKeyLocator().getKeyData()) << endl;
-      else if (signature->getKeyLocator().getType() == ndn_KeyLocatorType_KEYNAME) {
-        cout << "KeyName: " << signature->getKeyLocator().getKeyName().to_uri() << endl;
-        cout << "signature.keyLocator: ";
-        if ((int)signature->getKeyLocator().getKeyNameType() >= 0) {
-          bool showKeyNameData = true;
-          if (signature->getKeyLocator().getKeyNameType() == ndn_KeyNameType_PUBLISHER_PUBLIC_KEY_DIGEST)
-            cout << "PublisherPublicKeyDigest: ";
-          else if (signature->getKeyLocator().getKeyNameType() == ndn_KeyNameType_PUBLISHER_CERTIFICATE_DIGEST)
-            cout << "PublisherCertificateDigest: ";
-          else if (signature->getKeyLocator().getKeyNameType() == ndn_KeyNameType_PUBLISHER_ISSUER_KEY_DIGEST)
-            cout << "PublisherIssuerKeyDigest: ";
-          else if (signature->getKeyLocator().getKeyNameType() == ndn_KeyNameType_PUBLISHER_ISSUER_CERTIFICATE_DIGEST)
-            cout << "PublisherIssuerCertificateDigest: ";
-          else {
-            cout << "<unrecognized ndn_KeyNameType " << signature->getKeyLocator().getKeyNameType() << ">" << endl;
-            showKeyNameData = false;
-          }
-          if (showKeyNameData)
-            cout << (signature->getKeyLocator().getKeyData().size() > 0 ?
-                     toHex(*signature->getKeyLocator().getKeyData()).c_str() : "<none>") << endl;
-        }
-        else
-          cout << "<no key digest>" << endl;
-      }
-      else
-        cout << "<unrecognized ndn_KeyLocatorType " << signature->getKeyLocator().getType() << ">" << endl;
-    }
-    else
-      cout << "<none>" << endl;
-  }
-}
-
-static void onVerified(const char *prefix, const ptr_lib::shared_ptr<Data>& data)
-{
-  cout << prefix << " signature verification: VERIFIED" << endl;
-}
-
-static void onVerifyFailed(const char *prefix, const ptr_lib::shared_ptr<Data>& data)
-{
-  cout << prefix << " signature verification: FAILED" << endl;
-}
-
-int main(int argc, char** argv)
-{
-  try {
-    ptr_lib::shared_ptr<Data> data(new Data());
-    data->wireDecode(Data1, sizeof(Data1));
-    cout << "Decoded Data:" << endl;
-    dumpData(*data);
-    
-    Blob encoding = data->wireEncode();
-    
-    ptr_lib::shared_ptr<Data> reDecodedData(new Data());
-    reDecodedData->wireDecode(*encoding);
-    cout << endl << "Re-decoded Data:" << endl;
-    dumpData(*reDecodedData);
-  
-    ptr_lib::shared_ptr<Data> freshData(new Data(Name("/ndn/abc")));
-    const uint8_t freshContent[] = "SUCCESS!";
-    freshData->setContent(freshContent, sizeof(freshContent) - 1);
-    freshData->getMetaInfo().setTimestampMilliseconds(time(NULL) * 1000.0);
-    
-    ptr_lib::shared_ptr<MemoryIdentityStorage> identityStorage(new MemoryIdentityStorage());
-    ptr_lib::shared_ptr<MemoryPrivateKeyStorage> privateKeyStorage(new MemoryPrivateKeyStorage());
-    KeyChain keyChain
-      (ptr_lib::make_shared<IdentityManager>(identityStorage, privateKeyStorage), 
-       ptr_lib::make_shared<SelfVerifyPolicyManager>(identityStorage.get()));
-    
-    // Initialize the storage.
-    Name keyName("/testname/DSK-123");
-    Name certificateName = keyName.getSubName(0, keyName.size() - 1).append("KEY").append
-           (keyName.get(keyName.size() - 1)).append("ID-CERT").append("0");
-    identityStorage->addKey(keyName, KEY_TYPE_RSA, Blob(DEFAULT_PUBLIC_KEY_DER, sizeof(DEFAULT_PUBLIC_KEY_DER)));
-    privateKeyStorage->setKeyPairForKeyName
-      (keyName, DEFAULT_PUBLIC_KEY_DER, sizeof(DEFAULT_PUBLIC_KEY_DER), DEFAULT_PRIVATE_KEY_DER, sizeof(DEFAULT_PRIVATE_KEY_DER));
-    
-    keyChain.sign(*freshData, certificateName);
-    cout << endl << "Freshly-signed Data:" << endl;
-    dumpData(*freshData);
-    
-    keyChain.verifyData(freshData, bind(&onVerified, "Freshly-signed Data", _1), bind(&onVerifyFailed, "Freshly-signed Data", _1));
-  } catch (std::exception& e) {
-    cout << "exception: " << e.what() << endl;
-  }
-  return 0;
-}
diff --git a/tests/test-encode-decode-forwarding-entry.cpp b/tests/test-encode-decode-forwarding-entry.cpp
deleted file mode 100644
index 7f998fe..0000000
--- a/tests/test-encode-decode-forwarding-entry.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-/**
- * Copyright (C) 2013 Regents of the University of California.
- * @author: Jeff Thompson <jefft0@remap.ucla.edu>
- * See COPYING for copyright and distribution information.
- */
-
-#include <cstdlib>
-#include <sstream>
-#include <iostream>
-#include <ndn-cpp/interest.hpp>
-#include <ndn-cpp/data.hpp>
-#include <ndn-cpp/forwarding-entry.hpp>
-#include <ndn-cpp/security/key-chain.hpp>
-
-using namespace std;
-using namespace ndn;
-
-uint8_t Interest1[] = {
-0x01, 0xd2, 0xf2, 0xfa, 0xa5, 0x6e, 0x64, 0x6e, 0x78, 0x00, 0xfa, 0x02, 0x85, 0xe0, 0xa0, 0x1e, 0x09, 0x39, 0x68,
-0xf9, 0x74, 0x0c, 0xe7, 0xf4, 0x36, 0x1b, 0xab, 0xf5, 0xbb, 0x05, 0xa4, 0xe5, 0x5a, 0xac, 0xa5, 0xe5, 0x8f, 0x73,
-0xed, 0xde, 0xb8, 0xe0, 0x13, 0xaa, 0x8f, 0x00, 0xfa, 0xcd, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x72, 0x65, 0x67,
-0x00, 0xfa, 0x29, 0xad, 0x04, 0x82, 0x02, 0xaa, 0x03, 0xb2, 0x08, 0x85, 0x4d, 0xdb, 0xf6, 0x97, 0x79, 0xcd, 0xf4,
-0xef, 0x74, 0xbe, 0x99, 0x47, 0x44, 0x78, 0xc8, 0xbc, 0x3c, 0xa0, 0x87, 0x3e, 0x0f, 0xfa, 0x1f, 0xa6, 0x01, 0x20,
-0xaa, 0x27, 0x6d, 0xb1, 0x22, 0xb8, 0x34, 0x04, 0xe5, 0x95, 0xa8, 0xa3, 0xca, 0xea, 0xf0, 0x96, 0x30, 0x27, 0x66,
-0x58, 0xba, 0x4e, 0x7b, 0xea, 0xad, 0xb4, 0xb9, 0x1a, 0x8c, 0xc5, 0x8e, 0x19, 0xac, 0x4a, 0x42, 0x28, 0x95, 0x07,
-0xed, 0x8d, 0x60, 0x9a, 0xa9, 0xbe, 0xf6, 0x1a, 0x5a, 0x50, 0x7f, 0x34, 0x9c, 0x83, 0xd2, 0x94, 0x4b, 0x8c, 0x16,
-0xfe, 0xcf, 0xd9, 0x0d, 0x4a, 0x40, 0xdd, 0xb8, 0x68, 0x75, 0x92, 0xc0, 0xa5, 0x75, 0x17, 0x56, 0x42, 0x35, 0xb2,
-0xe3, 0x59, 0xdb, 0x54, 0xf5, 0x1a, 0x37, 0xe1, 0xac, 0x39, 0xe5, 0x18, 0xa2, 0x19, 0x6e, 0x3f, 0xfd, 0xa7, 0xeb,
-0x2f, 0xb3, 0x01, 0xf3, 0xc4, 0x04, 0xdd, 0x00, 0x00, 0xf2, 0x00, 0x01, 0xa2, 0x03, 0xe2, 0x02, 0x85, 0xef, 0x7c,
-0x4f, 0x5d, 0x47, 0x43, 0xa8, 0xb8, 0x58, 0x6e, 0xa2, 0xe7, 0x41, 0xb7, 0xfc, 0x39, 0xd1, 0xdc, 0x0d, 0xbe, 0x1b,
-0x19, 0x30, 0xe7, 0x87, 0xcf, 0xd1, 0xd8, 0x33, 0xea, 0x7a, 0x61, 0x00, 0x02, 0xba, 0xb5, 0x04, 0xfc, 0xe9, 0xe2,
-0x53, 0xd7, 0x00, 0x01, 0xe2, 0x01, 0x82, 0x19, 0xfd, 0x30, 0x82, 0x01, 0x9b, 0x30, 0x82, 0x01, 0x04, 0x02, 0x09,
-0x00, 0xb7, 0xd8, 0x5c, 0x90, 0x6b, 0xad, 0x52, 0xee, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
-0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x12, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x07, 0x61,
-0x78, 0x65, 0x6c, 0x63, 0x64, 0x76, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x32, 0x30, 0x34, 0x32, 0x38, 0x32, 0x33, 0x34,
-0x34, 0x33, 0x37, 0x5a, 0x17, 0x0d, 0x31, 0x32, 0x30, 0x35, 0x32, 0x38, 0x32, 0x33, 0x34, 0x34, 0x33, 0x37, 0x5a,
-0x30, 0x12, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x07, 0x61, 0x78, 0x65, 0x6c, 0x63, 0x64,
-0x76, 0x30, 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00,
-0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xe1, 0x7d, 0x30, 0xa7, 0xd8, 0x28, 0xab, 0x1b,
-0x84, 0x0b, 0x17, 0x54, 0x2d, 0xca, 0xf6, 0x20, 0x7a, 0xfd, 0x22, 0x1e, 0x08, 0x6b, 0x2a, 0x60, 0xd1, 0x6c, 0xb7,
-0xf5, 0x44, 0x48, 0xba, 0x9f, 0x3f, 0x08, 0xbc, 0xd0, 0x99, 0xdb, 0x21, 0xdd, 0x16, 0x2a, 0x77, 0x9e, 0x61, 0xaa,
-0x89, 0xee, 0xe5, 0x54, 0xd3, 0xa4, 0x7d, 0xe2, 0x30, 0xbc, 0x7a, 0xc5, 0x90, 0xd5, 0x24, 0x06, 0x7c, 0x38, 0x98,
-0xbb, 0xa6, 0xf5, 0xdc, 0x43, 0x60, 0xb8, 0x45, 0xed, 0xa4, 0x8c, 0xbd, 0x9c, 0xf1, 0x26, 0xa7, 0x23, 0x44, 0x5f,
-0x0e, 0x19, 0x52, 0xd7, 0x32, 0x5a, 0x75, 0xfa, 0xf5, 0x56, 0x14, 0x4f, 0x9a, 0x98, 0xaf, 0x71, 0x86, 0xb0, 0x27,
-0x86, 0x85, 0xb8, 0xe2, 0xc0, 0x8b, 0xea, 0x87, 0x17, 0x1b, 0x4d, 0xee, 0x58, 0x5c, 0x18, 0x28, 0x29, 0x5b, 0x53,
-0x95, 0xeb, 0x4a, 0x17, 0x77, 0x9f, 0x02, 0x03, 0x01, 0x00, 0x01, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
-0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x81, 0x81, 0x00, 0xcb, 0x3a, 0xb0, 0x35, 0x7d, 0x7c, 0xd2, 0xae,
-0x97, 0xed, 0x50, 0x1e, 0x51, 0xa3, 0xa0, 0xe2, 0x81, 0x7d, 0x41, 0x8e, 0x47, 0xfb, 0x17, 0x90, 0x64, 0x77, 0xaf,
-0x61, 0x49, 0x5a, 0x7e, 0x8d, 0x87, 0x89, 0x14, 0x10, 0x65, 0xb0, 0x82, 0xd0, 0x01, 0xf4, 0xb1, 0x51, 0x93, 0xd0,
-0xb4, 0x3f, 0xb6, 0x61, 0xcd, 0xe2, 0x0a, 0x64, 0x98, 0x37, 0x2c, 0x6a, 0xbb, 0xd3, 0xdc, 0xb9, 0xf0, 0xd1, 0x26,
-0x59, 0xef, 0x07, 0xb3, 0xc6, 0xdb, 0xdf, 0x8b, 0xdf, 0x2f, 0x65, 0x47, 0x7e, 0xed, 0x7a, 0xdc, 0xd4, 0x57, 0xd7,
-0x93, 0xb1, 0xc2, 0x7b, 0xad, 0xda, 0x7c, 0x5a, 0xde, 0x80, 0xce, 0x95, 0xb7, 0xd8, 0x82, 0x7f, 0xe7, 0x8c, 0x8a,
-0x35, 0xf3, 0xfb, 0x4b, 0xa6, 0x48, 0xa0, 0x81, 0xbe, 0x2c, 0xfe, 0x84, 0x23, 0x1a, 0xba, 0xb3, 0xc2, 0xb5, 0x31,
-0x74, 0x6d, 0xf2, 0xe0, 0x49, 0x2b, 0x00, 0x00, 0x00, 0x01, 0x9a, 0x02, 0xd5, 0x05, 0x8a, 0x04, 0xca, 0xbe, 0x73,
-0x65, 0x6c, 0x66, 0x72, 0x65, 0x67, 0x00, 0xf2, 0xfa, 0xa5, 0x6d, 0x65, 0x6b, 0x69, 0x00, 0x00, 0x04, 0xfa, 0x8e,
-0x33, 0x00, 0x03, 0xd2, 0xd6, 0x32, 0x31, 0x34, 0x37, 0x34, 0x38, 0x33, 0x36, 0x34, 0x37, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x02, 0xd2, 0x8e, 0x31, 0x00, 0x00,
-1
-};
-
-static inline string toString(const vector<uint8_t>& v)
-{
-  if (!&v)
-    return "";
-  
-  return string(&v[0], &v[0] + v.size());
-}
-
-static void dumpForwardingEntry(const ForwardingEntry& forwardingEntry) 
-{
-  cout << "action: " << forwardingEntry.getAction() << endl;
-  cout << "prefix: " << forwardingEntry.getPrefix().to_uri() << endl;
-  cout << "publisherPublicKeyDigest: " 
-       << (forwardingEntry.getPublisherPublicKeyDigest().getPublisherPublicKeyDigest().size() > 0 ? toHex(*forwardingEntry.getPublisherPublicKeyDigest().getPublisherPublicKeyDigest()) : "<none>") << endl;
-  cout << "faceId: ";
-  if (forwardingEntry.getFaceId() >= 0)
-    cout << forwardingEntry.getFaceId() << endl;
-  else
-    cout << "<none>" << endl;
-  
-  cout << "forwardingFlags:";
-  if (forwardingEntry.getForwardingFlags().getActive())
-    cout << " active";
-  if (forwardingEntry.getForwardingFlags().getChildInherit())
-    cout << " childInherit";
-  if (forwardingEntry.getForwardingFlags().getAdvertise())
-    cout << " advertise";
-  if (forwardingEntry.getForwardingFlags().getLast())
-    cout << " last";
-  if (forwardingEntry.getForwardingFlags().getCapture())
-    cout << " capture";
-  if (forwardingEntry.getForwardingFlags().getLocal())
-    cout << " local";
-  if (forwardingEntry.getForwardingFlags().getTap())
-    cout << " tap";
-  if (forwardingEntry.getForwardingFlags().getCaptureOk())
-    cout << " captureOk";
-  cout << endl;
-  
-  cout << "freshnessSeconds: ";
-  if (forwardingEntry.getFreshnessSeconds() >= 0)
-    cout << forwardingEntry.getFreshnessSeconds() << endl;
-  else
-    cout << "<none>" << endl;
-}
-
-/**
- * Show the interest name and scope, and expect the name to have 4 components where the last component is a data packet 
- * whose content is a forwarding entry.
- */
-static void dumpInterestWithForwardingEntry(const Interest& interest)
-{
-  if (interest.getName().getComponentCount() != 4) {
-    cout << "Error: expected the interest name to have 4 components.  Got: " << interest.getName().to_uri() << endl;
-    return;
-  }
-
-  cout << "scope: ";
-  if (interest.getScope() >= 0)
-    cout << interest.getScope() << endl;
-  else
-    cout << "<none>" << endl;
-  cout << "name[0]: " << toString(*interest.getName().getComponent(0).getValue()) << endl;
-  cout << "name[1]: " << toHex(*interest.getName().getComponent(1).getValue()) << endl;
-  cout << "name[2]: " << toString(*interest.getName().getComponent(2).getValue()) << endl;
-  cout << "name[3] decoded as Data, showing content as ForwardingEntry: " << endl;
-  
-  Data data;
-  data.wireDecode(*interest.getName().getComponent(3).getValue());
-  
-  ForwardingEntry forwardingEntry;
-  forwardingEntry.wireDecode(*data.getContent());
-  dumpForwardingEntry(forwardingEntry);
-}
-
-int main(int argc, char** argv)
-{
-  try {
-    Interest interest;
-    interest.wireDecode(Interest1, sizeof(Interest1));
-    cout << "Interest:" << endl;
-    dumpInterestWithForwardingEntry(interest);
-    
-    Blob encoding = interest.wireEncode();
-    cout << endl << "Re-encoded interest " << toHex(*encoding) << endl;
-
-    Interest reDecodedInterest;
-    reDecodedInterest.wireDecode(*encoding);
-    cout << "Re-decoded Interest:" << endl;
-    dumpInterestWithForwardingEntry(reDecodedInterest);
-  } catch (exception& e) {
-    cout << "exception: " << e.what() << endl;
-  }
-  return 0;
-}
diff --git a/tests/test-encode-decode-interest.cpp b/tests/test-encode-decode-interest.cpp
deleted file mode 100644
index 4065db0..0000000
--- a/tests/test-encode-decode-interest.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * Copyright (C) 2013 Regents of the University of California.
- * @author: Jeff Thompson <jefft0@remap.ucla.edu>
- * See COPYING for copyright and distribution information.
- */
-
-#include <cstdlib>
-#include <sstream>
-#include <iostream>
-#include <ndn-cpp/interest.hpp>
-
-using namespace std;
-using namespace ndn;
-
-uint8_t Interest1[] = {
-0x01, 0xd2,
-  0xf2, 0xfa, 0x9d, 0x6e, 0x64, 0x6e, 0x00, 0xfa, 0x9d, 0x61, 0x62, 0x63, 0x00, 0x00, 
-  0x05, 0x9a, 0x9e, 0x31, 0x32, 0x33, 0x00, 
-  0x05, 0xa2, 0x8e, 0x34, 0x00,
-  0x03, 0xe2, 
-    0x02, 0x85, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 
-                0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 
-  0x00,
-  0x02, 0xda, 0xfa, 0x9d, 0x61, 0x62, 0x63, 0x00, 0xea, 0x00, 0x00, 
-  0x05, 0xaa, 0x8e, 0x31, 0x00, 
-  0x02, 0xfa, 0x8e, 0x34, 0x00, 
-  0x02, 0xd2, 0x8e, 0x32, 0x00, 
-  0x03, 0x82, 0x9d, 0x01, 0xe0, 0x00, 0x00, 
-  0x02, 0xca, 0xb5, 0x61, 0x62, 0x61, 0x62, 0x61, 0x62, 0x00, 
-0x00, 
-1
-};
-
-static void dumpInterest(const Interest& interest)
-{
-  cout << "name: " << interest.getName().to_uri() << endl;
-  cout << "minSuffixComponents: ";
-  if (interest.getMinSuffixComponents() >= 0)
-    cout << interest.getMinSuffixComponents() << endl;
-  else
-    cout << "<none>" << endl;
-  cout << "maxSuffixComponents: ";
-  if (interest.getMaxSuffixComponents() >= 0)
-    cout << interest.getMaxSuffixComponents() << endl;
-  else
-    cout << "<none>" << endl;
-  cout << "publisherPublicKeyDigest: " 
-       << (interest.getPublisherPublicKeyDigest().getPublisherPublicKeyDigest().size() > 0 ? toHex(*interest.getPublisherPublicKeyDigest().getPublisherPublicKeyDigest()) : "<none>") << endl;
-  cout << "exclude: " 
-       << (interest.getExclude().getEntryCount() > 0 ? interest.getExclude().toUri() : "<none>") << endl;
-  cout << "lifetimeMilliseconds: ";
-  if (interest.getInterestLifetimeMilliseconds() >= 0)
-    cout << interest.getInterestLifetimeMilliseconds() << endl;
-  else
-    cout << "<none>" << endl;
-  cout << "childSelector: ";
-  if (interest.getChildSelector() >= 0)
-    cout << interest.getChildSelector() << endl;
-  else
-    cout << "<none>" << endl;
-  cout << "answerOriginKind: ";
-  if (interest.getAnswerOriginKind() >= 0)
-    cout << interest.getAnswerOriginKind() << endl;
-  else
-    cout << "<none>" << endl;
-  cout << "scope: ";
-  if (interest.getScope() >= 0)
-    cout << interest.getScope() << endl;
-  else
-    cout << "<none>" << endl;
-  cout << "nonce: " 
-       << (interest.getNonce().size() > 0 ? toHex(*interest.getNonce()) : "<none>") << endl;
-}
-
-int main(int argc, char** argv)
-{
-  try {
-    Interest interest;
-    interest.wireDecode(Interest1, sizeof(Interest1));
-    cout << "Interest:" << endl;
-    dumpInterest(interest);
-    
-    Blob encoding = interest.wireEncode();
-    cout << endl << "Re-encoded interest " << toHex(*encoding) << endl;
-
-    Interest reDecodedInterest;
-    reDecodedInterest.wireDecode(*encoding);
-    cout << "Re-decoded Interest:" << endl;
-    dumpInterest(reDecodedInterest);
-  } catch (exception& e) {
-    cout << "exception: " << e.what() << endl;
-  }
-  return 0;
-}
diff --git a/tests/test-get-async.cpp b/tests/test-get-async.cpp
index 2e9db0c..388d7a5 100644
--- a/tests/test-get-async.cpp
+++ b/tests/test-get-async.cpp
@@ -24,53 +24,47 @@
   Counter() {
     callbackCount_ = 0;
   }
-  
+
   void onData(const ptr_lib::shared_ptr<const Interest>& interest, const ptr_lib::shared_ptr<Data>& data)
   {
     ++callbackCount_;
-    cout << "Got data packet with name " << data->getName().to_uri() << endl;
-    for (size_t i = 0; i < data->getContent().size(); ++i)
-      cout << (*data->getContent())[i];
-    cout << endl;  
+    cout << "Got data packet with name " << data->getName().toUri() << endl;
+    // cout << string(reinterpret_cast<const char*>(data->getContent().value()), data->getContent().value_size()) << endl;
   }
 
   void onTimeout(const ptr_lib::shared_ptr<const Interest>& interest)
   {
     ++callbackCount_;
-    cout << "Time out for interest " << interest->getName().toUri() << endl;    
+    cout << "Time out for interest " << interest->getName().toUri() << endl;
   }
-  
+
   int callbackCount_;
 };
 
 int main(int argc, char** argv)
 {
   try {
-    // Connect to port 9695 until the testbed hubs use NDNx and are connected to the test repo.
-    Face face("borges.metwi.ucla.edu", 9695);
-    
+    Face face;
+
     // Counter holds data used by the callbacks.
     Counter counter;
-    
-    Name name1("/ndn/ucla.edu/apps/ndn-js-test/hello.txt/level2/%FD%05%0B%16%7D%95%0E");    
+
+    Name name1("/%C1.M.S.localhost/%C1.M.SRV/ndnd/KEY");
     cout << "Express name " << name1.toUri() << endl;
     // Use bind to pass the counter object to the callbacks.
     face.expressInterest(name1, bind(&Counter::onData, &counter, _1, _2), bind(&Counter::onTimeout, &counter, _1));
-    
-    Name name2("/ndn/ucla.edu/apps/lwndn-test/howdy.txt/%FD%05%05%E8%0C%CE%1D");
+
+    Name name2("/ndnx/ping");
     cout << "Express name " << name2.toUri() << endl;
     face.expressInterest(name2, bind(&Counter::onData, &counter, _1, _2), bind(&Counter::onTimeout, &counter, _1));
-    
+
     Name name3("/test/timeout");
     cout << "Express name " << name3.toUri() << endl;
     face.expressInterest(name3, bind(&Counter::onData, &counter, _1, _2), bind(&Counter::onTimeout, &counter, _1));
 
     // The main event loop.
-    while (counter.callbackCount_ < 3) {
-      face.processEvents();
-      // We need to sleep for a few milliseconds so we don't use 100% of the CPU.
-      usleep(10000);
-    }
+    face.processEvents();
+
   } catch (std::exception& e) {
     cout << "exception: " << e.what() << endl;
   }
diff --git a/tests/test-publish-async.cpp b/tests/test-publish-async.cpp
index 270e6fc..4f4ede7 100644
--- a/tests/test-publish-async.cpp
+++ b/tests/test-publish-async.cpp
@@ -12,7 +12,6 @@
 #include <ndn-cpp/face.hpp>
 #include <ndn-cpp/security/identity/memory-identity-storage.hpp>
 #include <ndn-cpp/security/identity/memory-private-key-storage.hpp>
-#include <ndn-cpp/security/policy/no-verify-policy-manager.hpp>
 #include <ndn-cpp/security/key-chain.hpp>
 
 using namespace std;
@@ -66,8 +65,10 @@
 
 class Echo {
 public:
-  Echo(KeyChain &keyChain, const Name& certificateName)
-  : keyChain_(keyChain), certificateName_(certificateName), responseCount_(0)
+  Echo(KeyChain &keyChain, Face &face)
+    : keyChain_(keyChain)
+    , face_(face)
+    , responseCount_(0)
   { 
   }
   
@@ -81,13 +82,17 @@
     // Make and sign a Data packet.
     Data data(interest->getName());
     string content(string("Echo ") + interest->getName().toUri());
+    data.setFreshnessPeriod(1000);
     data.setContent((const uint8_t *)&content[0], content.size());
-    data.getMetaInfo().setTimestampMilliseconds(time(NULL) * 1000.0);
-    keyChain_.sign(data, certificateName_);
-    Blob encodedData = data.wireEncode();
 
-    cout << "Sent content " << content << endl;
-    transport.send(*encodedData);
+    keyChain_.sign(data);
+
+    // Put data on wire
+    face_.put(data);
+
+    // Unregister prefix to ensure that the processing thread finishes after Data
+    // packet is send out to the forwarder
+    face_.unsetInterestFilter(registeredPrefixId);
   }
   
   // onRegisterFailed.
@@ -97,42 +102,39 @@
     cout << "Register failed for prefix " << prefix->toUri() << endl;
   }
 
-  KeyChain keyChain_;
-  Name certificateName_;
+  KeyChain &keyChain_;
+  Face &face_;
   int responseCount_;
 };
 
 int main(int argc, char** argv)
 {
   try {
-    Face face("localhost");
+    Face face;
         
     ptr_lib::shared_ptr<MemoryIdentityStorage> identityStorage(new MemoryIdentityStorage());
     ptr_lib::shared_ptr<MemoryPrivateKeyStorage> privateKeyStorage(new MemoryPrivateKeyStorage());
-    KeyChain keyChain
-      (ptr_lib::make_shared<IdentityManager>(identityStorage, privateKeyStorage), ptr_lib::shared_ptr<NoVerifyPolicyManager>(new NoVerifyPolicyManager()));
-    keyChain.setFace(&face);
-    
+    KeyChain keyChain(identityStorage, privateKeyStorage);
+
+    Name keyName("/testname/dsk-123");
+
     // Initialize the storage.
-    Name keyName("/testname/DSK-123");
-    Name certificateName = keyName.getSubName(0, keyName.size() - 1).append("KEY").append
-           (keyName.get(keyName.size() - 1)).append("ID-CERT").append("0");
-    identityStorage->addKey(keyName, KEY_TYPE_RSA, Blob(DEFAULT_PUBLIC_KEY_DER, sizeof(DEFAULT_PUBLIC_KEY_DER)));
-    privateKeyStorage->setKeyPairForKeyName
-      (keyName, DEFAULT_PUBLIC_KEY_DER, sizeof(DEFAULT_PUBLIC_KEY_DER), DEFAULT_PRIVATE_KEY_DER, sizeof(DEFAULT_PRIVATE_KEY_DER));
+    identityStorage->addKey(keyName, KEY_TYPE_RSA,
+                            PublicKey(DEFAULT_PUBLIC_KEY_DER, sizeof(DEFAULT_PUBLIC_KEY_DER)));
+
+    privateKeyStorage->setKeyPairForKeyName(keyName,
+                                            DEFAULT_PUBLIC_KEY_DER, sizeof(DEFAULT_PUBLIC_KEY_DER),
+                                            DEFAULT_PRIVATE_KEY_DER, sizeof(DEFAULT_PRIVATE_KEY_DER));
+
+    keyChain.identities().addCertificateAsDefault(*keyChain.identities().selfSign(keyName));
+    
    
-    Echo echo(keyChain, certificateName);
+    Echo echo(keyChain, face);
     Name prefix("/testecho");
     cout << "Register prefix  " << prefix.toUri() << endl;
     face.setInterestFilter(prefix, func_lib::ref(echo), func_lib::ref(echo));
     
-    // The main event loop.  
-    // Wait forever to receive one interest for the prefix.
-    while (echo.responseCount_ < 1) {
-      face.processEvents();
-      // We need to sleep for a few milliseconds so we don't use 100% of the CPU.
-      usleep(10000);
-    }
+    face.processEvents();
   } catch (std::exception& e) {
     cout << "exception: " << e.what() << endl;
   }
