diff --git a/src/data.cpp b/src/data.cpp
index c9f21fa..db60f80 100644
--- a/src/data.cpp
+++ b/src/data.cpp
@@ -11,7 +11,6 @@
 #include "c/data.h"
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 namespace ndn {
 
@@ -63,7 +62,7 @@
   if (data.signature_)
     signature_ = data.signature_->clone();
   else
-    signature_ = shared_ptr<Signature>();
+    signature_ = ptr_lib::shared_ptr<Signature>();
   
   name_ = data.name_;
   metaInfo_ = data.metaInfo_;
diff --git a/src/encoding/der/der.cpp b/src/encoding/der/der.cpp
index fc31161..94578b4 100644
--- a/src/encoding/der/der.cpp
+++ b/src/encoding/der/der.cpp
@@ -15,7 +15,6 @@
 INIT_LOGGER("ndn.der.DER");
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 namespace ndn {
 
@@ -132,7 +131,7 @@
   }
 }
 
-shared_ptr<DerNode>
+ptr_lib::shared_ptr<DerNode>
 DerNode::parse(InputIterator& start)
 {
   int type = ((uint8_t)start.PeekU8());
@@ -140,23 +139,23 @@
   // _LOG_DEBUG("Type: " << hex << setw(2) << setfill('0') << type);
   switch(type) {
     case DER_BOOLEAN:
-      return shared_ptr<DerBool>(new DerBool(start));
+      return ptr_lib::shared_ptr<DerBool>(new DerBool(start));
     case DER_INTEGER:
-      return shared_ptr<DerInteger>(new DerInteger(start));
+      return ptr_lib::shared_ptr<DerInteger>(new DerInteger(start));
     case DER_BIT_STRING:
-      return shared_ptr<DerBitString>(new DerBitString(start));
+      return ptr_lib::shared_ptr<DerBitString>(new DerBitString(start));
     case DER_OCTET_STRING:
-      return shared_ptr<DerOctetString>(new DerOctetString(start));
+      return ptr_lib::shared_ptr<DerOctetString>(new DerOctetString(start));
     case DER_NULL:
-      return shared_ptr<DerNull>(new DerNull(start));
+      return ptr_lib::shared_ptr<DerNull>(new DerNull(start));
     case DER_OBJECT_IDENTIFIER:
-      return shared_ptr<DerOid>(new DerOid(start));
+      return ptr_lib::shared_ptr<DerOid>(new DerOid(start));
     case DER_SEQUENCE:
-      return shared_ptr<DerSequence>(new DerSequence(start));
+      return ptr_lib::shared_ptr<DerSequence>(new DerSequence(start));
     case DER_PRINTABLE_STRING:
-      return shared_ptr<DerPrintableString>(new DerPrintableString(start));
+      return ptr_lib::shared_ptr<DerPrintableString>(new DerPrintableString(start));
     case DER_GENERALIZED_TIME:
-      return shared_ptr<DerGtime>(new DerGtime(start));
+      return ptr_lib::shared_ptr<DerGtime>(new DerGtime(start));
     default:
       throw DerDecodingException("Unimplemented DER type");
   }
@@ -190,7 +189,7 @@
   
   while (accSize < size_) {
     // _LOG_DEBUG("accSize: " << accSize);
-    shared_ptr<DerNode> nodePtr = DerNode::parse(start);
+    ptr_lib::shared_ptr<DerNode> nodePtr = DerNode::parse(start);
     accSize += nodePtr->getSize();
     addChild(nodePtr, false);
   }
@@ -215,7 +214,7 @@
 Blob
 DerComplex::getRaw()
 {
-  shared_ptr<vector<uint8_t> > blob(new vector<uint8_t>());
+  ptr_lib::shared_ptr<vector<uint8_t> > blob(new vector<uint8_t>());
   blob->insert(blob->end(), header_.begin(), header_.end());
 
   DerNodePtrList::iterator it = nodeList_.begin();
@@ -241,7 +240,7 @@
 }
 
 void
-DerComplex::addChild(shared_ptr<DerNode> nodePtr, bool notifyParent)
+DerComplex::addChild(ptr_lib::shared_ptr<DerNode> nodePtr, bool notifyParent)
 {
   nodePtr->setParent(this);
 
diff --git a/src/encoding/der/visitor/certificate-data-visitor.cpp b/src/encoding/der/visitor/certificate-data-visitor.cpp
index 4270d68..7edf794 100644
--- a/src/encoding/der/visitor/certificate-data-visitor.cpp
+++ b/src/encoding/der/visitor/certificate-data-visitor.cpp
@@ -18,7 +18,6 @@
 #include "certificate-data-visitor.hpp"
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 INIT_LOGGER("ndn.der.CertificateDataVisitor");
 
@@ -41,7 +40,7 @@
   children[1]->accept(subjectVisitor, param);
   PublicKeyVisitor pubkeyVisitor;
   Certificate* certData = ndnboost::any_cast<Certificate*>(param);
-  certData->setPublicKeyInfo(*ndnboost::any_cast<shared_ptr<PublicKey> >(children[2]->accept(pubkeyVisitor)));
+  certData->setPublicKeyInfo(*ndnboost::any_cast<ptr_lib::shared_ptr<PublicKey> >(children[2]->accept(pubkeyVisitor)));
       
   if(children.size() > 3)
     {
diff --git a/src/encoding/der/visitor/public-key-visitor.cpp b/src/encoding/der/visitor/public-key-visitor.cpp
index a2eab56..a5f5542 100644
--- a/src/encoding/der/visitor/public-key-visitor.cpp
+++ b/src/encoding/der/visitor/public-key-visitor.cpp
@@ -12,7 +12,6 @@
 #include "public-key-visitor.hpp"
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 namespace ndn {
 
@@ -24,10 +23,10 @@
   DerNodePtrList& children = derSeq.getChildren();
 
   SimpleVisitor simpleVisitor;
-  shared_ptr<DerSequence> algoSeq = dynamic_pointer_cast<DerSequence>(children[0]); 
+  ptr_lib::shared_ptr<DerSequence> algoSeq = ptr_lib::dynamic_pointer_cast<DerSequence>(children[0]); 
   OID algorithm = ndnboost::any_cast<OID>(algoSeq->getChildren()[0]->accept(simpleVisitor));  
   Blob raw = derSeq.getRaw();   
-  return ndnboost::any(shared_ptr<PublicKey>(new PublicKey(algorithm, raw)));    
+  return ndnboost::any(ptr_lib::shared_ptr<PublicKey>(new PublicKey(algorithm, raw)));    
 }
 
 } // der
diff --git a/src/name.cpp b/src/name.cpp
index 68005e6..b17a163 100644
--- a/src/name.cpp
+++ b/src/name.cpp
@@ -14,7 +14,6 @@
 #include "c/util/ndn_memory.h"
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 namespace ndn {
 
@@ -130,7 +129,7 @@
 Name::Component 
 Name::Component::fromNumber(uint64_t number)
 {
-  shared_ptr<vector<uint8_t> > value(new vector<uint8_t>());
+  ptr_lib::shared_ptr<vector<uint8_t> > value(new vector<uint8_t>());
   
   // First encode in little endian.
   while (number != 0) {
@@ -146,7 +145,7 @@
 Name::Component 
 Name::Component::fromNumberWithMarker(uint64_t number, uint8_t marker)
 {
-  shared_ptr<vector<uint8_t> > value(new vector<uint8_t>());
+  ptr_lib::shared_ptr<vector<uint8_t> > value(new vector<uint8_t>());
   
   // Add the leading marker.
   value->push_back(marker);
diff --git a/src/node.cpp b/src/node.cpp
index 586f990..3dd3861 100644
--- a/src/node.cpp
+++ b/src/node.cpp
@@ -18,7 +18,6 @@
 #include <ndn-cpp/node.hpp>
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 namespace ndn {
 
@@ -111,7 +110,7 @@
   signature->setSignature(Blob(signatureBits, (size_t)signatureBitsLength));
 }
 
-Node::Node(const shared_ptr<Transport>& transport, const shared_ptr<const Transport::ConnectionInfo>& connectionInfo)
+Node::Node(const ptr_lib::shared_ptr<Transport>& transport, const ptr_lib::shared_ptr<const Transport::ConnectionInfo>& connectionInfo)
 : transport_(transport), connectionInfo_(connectionInfo),
   ndndIdFetcherInterest_(Name("/%C1.M.S.localhost/%C1.M.SRV/ndnd/KEY"), 4000.0)
 {
@@ -125,8 +124,8 @@
     transport_->connect(*connectionInfo_, *this);
   
   uint64_t pendingInterestId = PendingInterest::getNextPendingInterestId();
-  pendingInterestTable_.push_back(shared_ptr<PendingInterest>(new PendingInterest
-    (pendingInterestId, shared_ptr<const Interest>(new Interest(interest)), onData, onTimeout)));
+  pendingInterestTable_.push_back(ptr_lib::shared_ptr<PendingInterest>(new PendingInterest
+    (pendingInterestId, ptr_lib::shared_ptr<const Interest>(new Interest(interest)), onData, onTimeout)));
   
   Blob encoding = interest.wireEncode(wireFormat);  
   transport_->send(*encoding);
@@ -155,13 +154,13 @@
   if (ndndId_.size() == 0) {
     // First fetch the ndndId of the connected hub.
     NdndIdFetcher fetcher
-      (shared_ptr<NdndIdFetcher::Info>(new NdndIdFetcher::Info
+      (ptr_lib::shared_ptr<NdndIdFetcher::Info>(new NdndIdFetcher::Info
         (this, registeredPrefixId, prefix, onInterest, onRegisterFailed, flags, wireFormat)));
-    // It is OK for func_lib::function make a copy of the function object because the Info is in a shared_ptr.
+    // It is OK for func_lib::function make a copy of the function object because the Info is in a ptr_lib::shared_ptr.
     expressInterest(ndndIdFetcherInterest_, fetcher, fetcher, wireFormat);
   }
   else
-    registerPrefixHelper(registeredPrefixId, make_shared<const Name>(prefix), onInterest, onRegisterFailed, flags, wireFormat);
+    registerPrefixHelper(registeredPrefixId, ptr_lib::make_shared<const Name>(prefix), onInterest, onRegisterFailed, flags, wireFormat);
   
   return registeredPrefixId;
 }
@@ -178,7 +177,7 @@
 }
 
 void 
-Node::NdndIdFetcher::operator()(const shared_ptr<const Interest>& interest, const shared_ptr<Data>& ndndIdData)
+Node::NdndIdFetcher::operator()(const ptr_lib::shared_ptr<const Interest>& interest, const ptr_lib::shared_ptr<Data>& ndndIdData)
 {
   const Sha256WithRsaSignature *signature = dynamic_cast<const Sha256WithRsaSignature*>(ndndIdData->getSignature());
   if (signature && signature->getPublisherPublicKeyDigest().getPublisherPublicKeyDigest().size() > 0) {
@@ -193,14 +192,14 @@
 }
 
 void 
-Node::NdndIdFetcher::operator()(const shared_ptr<const Interest>& timedOutInterest)
+Node::NdndIdFetcher::operator()(const ptr_lib::shared_ptr<const Interest>& timedOutInterest)
 {
   info_->onRegisterFailed_(info_->prefix_);
 }
 
 void 
 Node::registerPrefixHelper
-  (uint64_t registeredPrefixId, const shared_ptr<const Name>& prefix, const OnInterest& onInterest, const OnRegisterFailed& onRegisterFailed, 
+  (uint64_t registeredPrefixId, const ptr_lib::shared_ptr<const Name>& prefix, const OnInterest& onInterest, const OnRegisterFailed& onRegisterFailed, 
    const ForwardingFlags& flags, WireFormat& wireFormat)
 {
   // Create a ForwardingEntry.
@@ -229,7 +228,7 @@
   Blob encodedInterest = interest.wireEncode();
   
   // Save the onInterest callback and send the registration interest.
-  registeredPrefixTable_.push_back(shared_ptr<RegisteredPrefix>(new RegisteredPrefix(registeredPrefixId, prefix, onInterest)));
+  registeredPrefixTable_.push_back(ptr_lib::shared_ptr<RegisteredPrefix>(new RegisteredPrefix(registeredPrefixId, prefix, onInterest)));
   
   transport_->send(*encodedInterest);
 }
@@ -244,7 +243,7 @@
   for (int i = (int)pendingInterestTable_.size() - 1; i >= 0; --i) {
     if (pendingInterestTable_[i]->isTimedOut(nowMilliseconds)) {
       // Save the PendingInterest and remove it from the PIT.  Then call the callback.
-      shared_ptr<PendingInterest> pendingInterest = pendingInterestTable_[i];
+      ptr_lib::shared_ptr<PendingInterest> pendingInterest = pendingInterestTable_[i];
       pendingInterestTable_.erase(pendingInterestTable_.begin() + i);
       pendingInterest->callTimeout();
       
@@ -260,7 +259,7 @@
   BinaryXmlDecoder decoder(element, elementLength);
   
   if (decoder.peekDTag(ndn_BinaryXml_DTag_Interest)) {
-    shared_ptr<Interest> interest(new Interest());
+    ptr_lib::shared_ptr<Interest> interest(new Interest());
     interest->wireDecode(element, elementLength);
     
     RegisteredPrefix *entry = getEntryForRegisteredPrefix(interest->getName());
@@ -268,14 +267,14 @@
       entry->getOnInterest()(entry->getPrefix(), interest, *transport_, entry->getRegisteredPrefixId());
   }
   else if (decoder.peekDTag(ndn_BinaryXml_DTag_ContentObject)) {
-    shared_ptr<Data> data(new Data());
+    ptr_lib::shared_ptr<Data> data(new Data());
     data->wireDecode(element, elementLength);
     
     int iPitEntry = getEntryIndexForExpressedInterest(data->getName());
     if (iPitEntry >= 0) {
       // Copy pointers to the needed objects and remove the PIT entry before the calling the callback.
       const OnData onData = pendingInterestTable_[iPitEntry]->getOnData();
-      const shared_ptr<const Interest> interest = pendingInterestTable_[iPitEntry]->getInterest();
+      const ptr_lib::shared_ptr<const Interest> interest = pendingInterestTable_[iPitEntry]->getInterest();
       pendingInterestTable_.erase(pendingInterestTable_.begin() + iPitEntry);
       onData(interest, data);
     }
@@ -334,7 +333,7 @@
 }
 
 Node::PendingInterest::PendingInterest
-  (uint64_t pendingInterestId, const shared_ptr<const Interest>& interest, const OnData& onData, const OnTimeout& onTimeout)
+  (uint64_t pendingInterestId, const ptr_lib::shared_ptr<const Interest>& interest, const OnData& onData, const OnTimeout& onTimeout)
 : pendingInterestId_(pendingInterestId), interest_(interest), onData_(onData), onTimeout_(onTimeout),
   interestStruct_(new struct ndn_Interest)
 {
diff --git a/src/security/certificate/certificate-extension.cpp b/src/security/certificate/certificate-extension.cpp
index b2c1bad..f081f2a 100644
--- a/src/security/certificate/certificate-extension.cpp
+++ b/src/security/certificate/certificate-extension.cpp
@@ -11,18 +11,17 @@
 #include <ndn-cpp/security/certificate/certificate-extension.hpp>
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 namespace ndn {
 
-shared_ptr<der::DerNode> 
+ptr_lib::shared_ptr<der::DerNode> 
 CertificateExtension::toDer()
 {
-  shared_ptr<der::DerSequence> root(new der::DerSequence);
+  ptr_lib::shared_ptr<der::DerSequence> root(new der::DerSequence);
     
-  shared_ptr<der::DerOid> extensionId(new der::DerOid(extensionId_));
-  shared_ptr<der::DerBool> isCritical(new der::DerBool(isCritical_));
-  shared_ptr<der::DerOctetString> extensionValue(new der::DerOctetString(*extensionValue_));
+  ptr_lib::shared_ptr<der::DerOid> extensionId(new der::DerOid(extensionId_));
+  ptr_lib::shared_ptr<der::DerBool> isCritical(new der::DerBool(isCritical_));
+  ptr_lib::shared_ptr<der::DerOctetString> extensionValue(new der::DerOctetString(*extensionValue_));
 
   root->addChild(extensionId);
   root->addChild(isCritical);
diff --git a/src/security/certificate/certificate-subject-description.cpp b/src/security/certificate/certificate-subject-description.cpp
index ee2310c..9aa511f 100644
--- a/src/security/certificate/certificate-subject-description.cpp
+++ b/src/security/certificate/certificate-subject-description.cpp
@@ -10,17 +10,16 @@
 #include <ndn-cpp/security/certificate/certificate-subject-description.hpp>
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 namespace ndn {
 
-shared_ptr<der::DerNode> 
+ptr_lib::shared_ptr<der::DerNode> 
 CertificateSubjectDescription::toDer()
 {
-  shared_ptr<der::DerSequence> root(new der::DerSequence());
+  ptr_lib::shared_ptr<der::DerSequence> root(new der::DerSequence());
 
-  shared_ptr<der::DerOid> oid(new der::DerOid(oid_));
-  shared_ptr<der::DerPrintableString> value(new der::DerPrintableString(value_));
+  ptr_lib::shared_ptr<der::DerOid> oid(new der::DerOid(oid_));
+  ptr_lib::shared_ptr<der::DerPrintableString> value(new der::DerPrintableString(value_));
 
   root->addChild(oid);
   root->addChild(value);
diff --git a/src/security/certificate/certificate.cpp b/src/security/certificate/certificate.cpp
index 6856a2a..82b6364 100644
--- a/src/security/certificate/certificate.cpp
+++ b/src/security/certificate/certificate.cpp
@@ -22,7 +22,6 @@
 INIT_LOGGER("ndn.security.Certificate");
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 namespace ndn {
 
@@ -68,20 +67,20 @@
 void
 Certificate::encode()
 {
-  shared_ptr<der::DerSequence> root(new der::DerSequence());
+  ptr_lib::shared_ptr<der::DerSequence> root(new der::DerSequence());
   
-  shared_ptr<der::DerSequence> validity(new der::DerSequence());
-  shared_ptr<der::DerGtime> notBefore(new der::DerGtime(notBefore_));
-  shared_ptr<der::DerGtime> notAfter(new der::DerGtime(notAfter_));
+  ptr_lib::shared_ptr<der::DerSequence> validity(new der::DerSequence());
+  ptr_lib::shared_ptr<der::DerGtime> notBefore(new der::DerGtime(notBefore_));
+  ptr_lib::shared_ptr<der::DerGtime> notAfter(new der::DerGtime(notAfter_));
   validity->addChild(notBefore);
   validity->addChild(notAfter);
   root->addChild(validity);
 
-  shared_ptr<der::DerSequence> subjectList(new der::DerSequence());
+  ptr_lib::shared_ptr<der::DerSequence> subjectList(new der::DerSequence());
   SubjectDescriptionList::iterator it = subjectDescriptionList_.begin();
   for(; it != subjectDescriptionList_.end(); it++)
     {
-      shared_ptr<der::DerNode> child = it->toDer();
+      ptr_lib::shared_ptr<der::DerNode> child = it->toDer();
       subjectList->addChild(child);
     }
   root->addChild(subjectList);
@@ -90,7 +89,7 @@
 
   if(!extensionList_.empty())
     {
-      shared_ptr<der::DerSequence> extnList(new der::DerSequence());
+      ptr_lib::shared_ptr<der::DerSequence> extnList(new der::DerSequence());
       ExtensionList::iterator it = extensionList_.begin();
       for(; it != extensionList_.end(); it++)
         extnList->addChild(it->toDer());
@@ -102,7 +101,7 @@
 
   root->encode(start);
 
-  shared_ptr<vector<uint8_t> > blob = blobStream.buf();
+  ptr_lib::shared_ptr<vector<uint8_t> > blob = blobStream.buf();
   setContent(blob);
   getMetaInfo().setType(ndn_ContentType_KEY);
 }
@@ -114,7 +113,7 @@
 
   ndnboost::iostreams::stream<ndnboost::iostreams::array_source> is((const char*)blob.buf(), blob.size());
 
-  shared_ptr<der::DerNode> node = der::DerNode::parse(reinterpret_cast<der::InputIterator&>(is));
+  ptr_lib::shared_ptr<der::DerNode> node = der::DerNode::parse(reinterpret_cast<der::InputIterator&>(is));
 
   // der::PrintVisitor printVisitor;
   // node->accept(printVisitor, string(""));
@@ -138,7 +137,7 @@
 
   ndnboost::iostreams::stream<ndnboost::iostreams::array_source> is((const char*)key_.getKeyDer().buf(), key_.getKeyDer().size());
 
-  shared_ptr<der::DerNode> keyRoot = der::DerNode::parse(reinterpret_cast<der::InputIterator&> (is));
+  ptr_lib::shared_ptr<der::DerNode> keyRoot = der::DerNode::parse(reinterpret_cast<der::InputIterator&> (is));
 
   der::PrintVisitor printVisitor;
   keyRoot->accept(printVisitor, string(""));
diff --git a/src/security/certificate/public-key.cpp b/src/security/certificate/public-key.cpp
index 1d5deb8..f57f5a6 100644
--- a/src/security/certificate/public-key.cpp
+++ b/src/security/certificate/public-key.cpp
@@ -15,11 +15,10 @@
 #include <ndn-cpp/security/certificate/public-key.hpp>
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 namespace ndn {
 
-shared_ptr<der::DerNode>
+ptr_lib::shared_ptr<der::DerNode>
 PublicKey::toDer()
 {
   ndnboost::iostreams::stream<ndnboost::iostreams::array_source> is((const char*)keyDer_.buf (), keyDer_.size ());
@@ -29,7 +28,7 @@
 
 static int RSA_OID[] = { 1, 2, 840, 113549, 1, 1, 1 };
 
-shared_ptr<PublicKey>
+ptr_lib::shared_ptr<PublicKey>
 PublicKey::fromDer(const Blob& keyDer)
 {
   // Use a temporary pointer since d2i updates it.
@@ -39,7 +38,7 @@
     throw UnrecognizedKeyFormatException("Error decoding public key DER");  
   RSA_free(publicKey);
   
-  return shared_ptr<PublicKey>(new PublicKey(OID(vector<int>(RSA_OID, RSA_OID + sizeof(RSA_OID))), keyDer));
+  return ptr_lib::shared_ptr<PublicKey>(new PublicKey(OID(vector<int>(RSA_OID, RSA_OID + sizeof(RSA_OID))), keyDer));
 }
 
 Blob
diff --git a/src/security/identity/basic-identity-storage.cpp b/src/security/identity/basic-identity-storage.cpp
index 85af9a9..46a98bf 100644
--- a/src/security/identity/basic-identity-storage.cpp
+++ b/src/security/identity/basic-identity-storage.cpp
@@ -26,7 +26,6 @@
 INIT_LOGGER("BasicIdentityStorage");
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 namespace ndn
 {
@@ -445,7 +444,7 @@
   sqlite3_finalize(statement);
 }
 
-shared_ptr<Data> 
+ptr_lib::shared_ptr<Data> 
 BasicIdentityStorage::getCertificate(const Name &certificateName, bool allowAny)
 {
   if (doesCertificateExist(certificateName)) {
@@ -469,7 +468,7 @@
       
     int res = sqlite3_step(statement);
       
-    shared_ptr<Data> data(new Data());
+    ptr_lib::shared_ptr<Data> data(new Data());
 
     if (res == SQLITE_ROW)
       data->wireDecode((const uint8_t*)sqlite3_column_blob(statement, 0), sqlite3_column_bytes(statement, 0));            
@@ -479,7 +478,7 @@
   }
   else {
     _LOG_DEBUG("Certificate does not exist!");
-    return shared_ptr<Data>();
+    return ptr_lib::shared_ptr<Data>();
   }
 }
 
diff --git a/src/security/identity/identity-manager.cpp b/src/security/identity/identity-manager.cpp
index 28e1d10..88e6782 100644
--- a/src/security/identity/identity-manager.cpp
+++ b/src/security/identity/identity-manager.cpp
@@ -26,7 +26,6 @@
 INIT_LOGGER("ndn.security.IdentityManager")
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 namespace ndn {
 
@@ -41,7 +40,7 @@
   Name keyName = generateRSAKeyPairAsDefault(identityName, true);
 
   _LOG_DEBUG("Create self-signed certificate");
-  shared_ptr<IdentityCertificate> selfCert = selfSign(keyName); 
+  ptr_lib::shared_ptr<IdentityCertificate> selfCert = selfSign(keyName); 
   
   _LOG_DEBUG("Add self-signed certificate as default");
 
@@ -63,7 +62,7 @@
   privateKeyStorage_->generateKeyPair(keyName.toUri(), keyType, keySize);
 
   _LOG_DEBUG("Create a key record in public storage");
-  shared_ptr<PublicKey> pubKey = privateKeyStorage_->getPublicKey(keyName.toUri());
+  ptr_lib::shared_ptr<PublicKey> pubKey = privateKeyStorage_->getPublicKey(keyName.toUri());
   identityStorage_->addKey(keyName, keyType, pubKey->getKeyDer());
 
   return keyName;
@@ -96,9 +95,9 @@
   Name keyName = getKeyNameFromCertificatePrefix(certificatePrefix);
   
   Blob keyBlob = identityStorage_->getKey(keyName);
-  shared_ptr<PublicKey> publicKey = PublicKey::fromDer(keyBlob);
+  ptr_lib::shared_ptr<PublicKey> publicKey = PublicKey::fromDer(keyBlob);
 
-  shared_ptr<IdentityCertificate> certificate = createIdentityCertificate
+  ptr_lib::shared_ptr<IdentityCertificate> certificate = createIdentityCertificate
     (certificatePrefix, *publicKey,  signerCertificateName, notBefore, notAfter);
 
   identityStorage_->addCertificate(*certificate);
@@ -113,7 +112,7 @@
                                            const MillisecondsSince1970& notBefore,
                                            const MillisecondsSince1970& notAfter)
 {
-  shared_ptr<IdentityCertificate> certificate(new IdentityCertificate());
+  ptr_lib::shared_ptr<IdentityCertificate> certificate(new IdentityCertificate());
   Name keyName = getKeyNameFromCertificatePrefix(certificatePrefix);
   
   Name certificateName = certificatePrefix;
@@ -131,7 +130,7 @@
   certificate->addSubjectDescription(CertificateSubjectDescription("2.5.4.41", keyName.toUri()));
   certificate->encode();
 
-  shared_ptr<Sha256WithRsaSignature> sha256Sig(new Sha256WithRsaSignature());
+  ptr_lib::shared_ptr<Sha256WithRsaSignature> sha256Sig(new Sha256WithRsaSignature());
 
   KeyLocator keyLocator;    
   keyLocator.setType(ndn_KeyLocatorType_KEYNAME);
@@ -144,7 +143,7 @@
 
   SignedBlob unsignedData = certificate->wireEncode();
 
-  shared_ptr<IdentityCertificate> signerCertificate = getCertificate(signerCertificateName);
+  ptr_lib::shared_ptr<IdentityCertificate> signerCertificate = getCertificate(signerCertificateName);
   Name signerkeyName = signerCertificate->getPublicKeyName();
 
   Blob sigBits = privateKeyStorage_->sign(unsignedData, signerkeyName);
@@ -189,12 +188,12 @@
 IdentityManager::signByCertificate(const uint8_t* buffer, size_t bufferLength, const Name& certificateName)
 {
   Name keyName = IdentityCertificate::certificateNameToPublicKeyName(certificateName);
-  shared_ptr<PublicKey> publicKey = privateKeyStorage_->getPublicKey(keyName.toUri());
+  ptr_lib::shared_ptr<PublicKey> publicKey = privateKeyStorage_->getPublicKey(keyName.toUri());
 
   Blob sigBits = privateKeyStorage_->sign(buffer, bufferLength, keyName.toUri());
 
   //For temporary usage, we support RSA + SHA256 only, but will support more.
-  shared_ptr<Sha256WithRsaSignature> sha256Sig(new Sha256WithRsaSignature());
+  ptr_lib::shared_ptr<Sha256WithRsaSignature> sha256Sig(new Sha256WithRsaSignature());
 
   KeyLocator keyLocator;    
   keyLocator.setType(ndn_KeyLocatorType_KEYNAME);
@@ -211,7 +210,7 @@
 IdentityManager::signByCertificate(Data &data, const Name &certificateName, WireFormat& wireFormat)
 {
   Name keyName = IdentityCertificate::certificateNameToPublicKeyName(certificateName);
-  shared_ptr<PublicKey> publicKey = privateKeyStorage_->getPublicKey(keyName);
+  ptr_lib::shared_ptr<PublicKey> publicKey = privateKeyStorage_->getPublicKey(keyName);
 
   // For temporary usage, we support RSA + SHA256 only, but will support more.
   data.setSignature(Sha256WithRsaSignature());
@@ -236,17 +235,17 @@
   data.wireEncode(wireFormat);
 }
 
-shared_ptr<IdentityCertificate>
+ptr_lib::shared_ptr<IdentityCertificate>
 IdentityManager::selfSign(const Name& keyName)
 {
-  shared_ptr<IdentityCertificate> certificate(new IdentityCertificate());
+  ptr_lib::shared_ptr<IdentityCertificate> certificate(new IdentityCertificate());
   
   Name certificateName = keyName.getSubName(0, keyName.size() - 1);
   certificateName.append("KEY").append(keyName.get(keyName.size() - 1)).append("ID-CERT").append("0");
   certificate->setName(certificateName);
 
   Blob keyBlob = identityStorage_->getKey(keyName);
-  shared_ptr<PublicKey> publicKey = PublicKey::fromDer(keyBlob);
+  ptr_lib::shared_ptr<PublicKey> publicKey = PublicKey::fromDer(keyBlob);
 
 #if NDN_CPP_HAVE_GMTIME_SUPPORT
   time_t nowSeconds = time(NULL);
@@ -268,7 +267,7 @@
   certificate->addSubjectDescription(CertificateSubjectDescription("2.5.4.41", keyName.toUri()));
   certificate->encode();
 
-  shared_ptr<Sha256WithRsaSignature> sha256Sig(new Sha256WithRsaSignature());
+  ptr_lib::shared_ptr<Sha256WithRsaSignature> sha256Sig(new Sha256WithRsaSignature());
 
   KeyLocator keyLocator;    
   keyLocator.setType(ndn_KeyLocatorType_KEYNAME);
diff --git a/src/security/identity/memory-identity-storage.cpp b/src/security/identity/memory-identity-storage.cpp
index c5fb409..26341fa 100644
--- a/src/security/identity/memory-identity-storage.cpp
+++ b/src/security/identity/memory-identity-storage.cpp
@@ -14,7 +14,6 @@
 #include <ndn-cpp/security/identity/memory-identity-storage.hpp>
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 namespace ndn {
 
@@ -64,13 +63,13 @@
   if (doesKeyExist(keyName))
     throw SecurityException("a key with the same name already exists!");
   
-  keyStore_[keyName.toUri()] = make_shared<KeyRecord>(keyType, publicKeyDer);
+  keyStore_[keyName.toUri()] = ptr_lib::make_shared<KeyRecord>(keyType, publicKeyDer);
 }
 
 Blob
 MemoryIdentityStorage::getKey(const Name& keyName)
 {
-  map<string, shared_ptr<KeyRecord> >::iterator record = keyStore_.find(keyName.toUri());
+  map<string, ptr_lib::shared_ptr<KeyRecord> >::iterator record = keyStore_.find(keyName.toUri());
   if (record == keyStore_.end())
     // Not found.  Silently return null.
     return Blob();
@@ -130,9 +129,9 @@
   map<string, Blob>::iterator record = certificateStore_.find(certificateName.toUri());
   if (record == certificateStore_.end())
     // Not found.  Silently return null.
-    return shared_ptr<Data>();
+    return ptr_lib::shared_ptr<Data>();
   
-  shared_ptr<Data> data(new Data());
+  ptr_lib::shared_ptr<Data> data(new Data());
   data->wireDecode(*record->second);
   return data;
 }
diff --git a/src/security/identity/memory-private-key-storage.cpp b/src/security/identity/memory-private-key-storage.cpp
index b2bbcb5..7c3a2e0 100644
--- a/src/security/identity/memory-private-key-storage.cpp
+++ b/src/security/identity/memory-private-key-storage.cpp
@@ -13,7 +13,6 @@
 #include <ndn-cpp/security/identity/memory-private-key-storage.hpp>
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 namespace ndn {
 
@@ -26,7 +25,7 @@
    size_t privateKeyDerLength)
 {
   publicKeyStore_[keyName.toUri()] = PublicKey::fromDer(Blob(publicKeyDer, publicKeyDerLength));
-  privateKeyStore_[keyName.toUri()] = make_shared<RsaPrivateKey>(privateKeyDer, privateKeyDerLength);
+  privateKeyStore_[keyName.toUri()] = ptr_lib::make_shared<RsaPrivateKey>(privateKeyDer, privateKeyDerLength);
 }
 
 void 
@@ -37,10 +36,10 @@
 #endif
 }
 
-shared_ptr<PublicKey> 
+ptr_lib::shared_ptr<PublicKey> 
 MemoryPrivateKeyStorage::getPublicKey(const Name& keyName)
 {
-  map<string, shared_ptr<PublicKey> >::iterator publicKey = publicKeyStore_.find(keyName.toUri());
+  map<string, ptr_lib::shared_ptr<PublicKey> >::iterator publicKey = publicKeyStore_.find(keyName.toUri());
   if (publicKey == publicKeyStore_.end())
     throw SecurityException(string("MemoryPrivateKeyStorage: Cannot find public key ") + keyName.toUri());
   return publicKey->second;
@@ -59,7 +58,7 @@
   unsigned int signatureBitsLength;
   
   // Find the private key and sign.
-  map<string, shared_ptr<RsaPrivateKey> >::iterator privateKey = privateKeyStore_.find(keyName.toUri());
+  map<string, ptr_lib::shared_ptr<RsaPrivateKey> >::iterator privateKey = privateKeyStore_.find(keyName.toUri());
   if (privateKey == privateKeyStore_.end())
     throw SecurityException(string("MemoryPrivateKeyStorage: Cannot find private key ") + keyName.toUri());
   if (!RSA_sign(NID_sha256, digest, sizeof(digest), signatureBits, &signatureBitsLength, privateKey->second->getPrivateKey()))
diff --git a/src/security/identity/osx-private-key-storage.cpp b/src/security/identity/osx-private-key-storage.cpp
index aa6b7b8..e504616 100644
--- a/src/security/identity/osx-private-key-storage.cpp
+++ b/src/security/identity/osx-private-key-storage.cpp
@@ -18,7 +18,6 @@
 #include <ndn-cpp/security/security-exception.hpp>
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 INIT_LOGGER("ndn.OSXPrivateKeyStorage");
 
@@ -124,7 +123,7 @@
         throw SecurityException("Fail to create a symmetric key");
   }
 
-  shared_ptr<PublicKey> OSXPrivateKeyStorage::getPublicKey(const Name & keyName)
+  ptr_lib::shared_ptr<PublicKey> OSXPrivateKeyStorage::getPublicKey(const Name & keyName)
   {
     _LOG_TRACE("OSXPrivateKeyStorage::getPublickey");
 
diff --git a/src/security/key-chain.cpp b/src/security/key-chain.cpp
index fc05969..26dcec8 100644
--- a/src/security/key-chain.cpp
+++ b/src/security/key-chain.cpp
@@ -12,7 +12,6 @@
 #include <ndn-cpp/security/key-chain.hpp>
 
 using namespace std;
-using namespace ndn::ptr_lib;
 using namespace ndn::func_lib;
 #if NDN_CPP_HAVE_STD_FUNCTION
 // In the std library, the placeholders are in a different namespace than boost.
@@ -21,7 +20,7 @@
 
 namespace ndn {
   
-KeyChain::KeyChain(const shared_ptr<IdentityManager>& identityManager, const shared_ptr<PolicyManager>& policyManager)
+KeyChain::KeyChain(const ptr_lib::shared_ptr<IdentityManager>& identityManager, const ptr_lib::shared_ptr<PolicyManager>& policyManager)
 : identityManager_(identityManager), policyManager_(policyManager), face_(0), maxSteps_(100)
 {  
 }
@@ -32,7 +31,7 @@
   identityManager_->signByCertificate(data, certificateName, wireFormat);
 }
 
-shared_ptr<Signature> 
+ptr_lib::shared_ptr<Signature> 
 KeyChain::sign(const uint8_t* buffer, size_t bufferLength, const Name& certificateName)
 {
   return identityManager_->signByCertificate(buffer, bufferLength, certificateName);
@@ -62,7 +61,7 @@
   identityManager_->signByCertificate(data, signingCertificateName, wireFormat);  
 }
 
-shared_ptr<Signature> 
+ptr_lib::shared_ptr<Signature> 
 KeyChain::signByIdentity(const uint8_t* buffer, size_t bufferLength, const Name& identityName)
 {
   Name signingCertificateName = identityManager_->getDefaultCertificateNameForIdentity(identityName);
@@ -75,12 +74,12 @@
 
 void
 KeyChain::verifyData
-  (const shared_ptr<Data>& data, const OnVerified& onVerified, const OnVerifyFailed& onVerifyFailed, int stepCount)
+  (const ptr_lib::shared_ptr<Data>& data, const OnVerified& onVerified, const OnVerifyFailed& onVerifyFailed, int stepCount)
 {
   _LOG_TRACE("Enter Verify");
 
   if (policyManager_->requireVerify(*data)) {
-    shared_ptr<ValidationRequest> nextStep = policyManager_->checkVerificationPolicy
+    ptr_lib::shared_ptr<ValidationRequest> nextStep = policyManager_->checkVerificationPolicy
       (data, stepCount, onVerified, onVerifyFailed);
     if (nextStep)
       face_->expressInterest
@@ -95,7 +94,7 @@
 }
 
 void
-KeyChain::onCertificateData(const shared_ptr<const Interest> &interest, const shared_ptr<Data> &data, shared_ptr<ValidationRequest> nextStep)
+KeyChain::onCertificateData(const ptr_lib::shared_ptr<const Interest> &interest, const ptr_lib::shared_ptr<Data> &data, ptr_lib::shared_ptr<ValidationRequest> nextStep)
 {
   // Try to verify the certificate (data) according to the parameters in nextStep.
   verifyData(data, nextStep->onVerified_, nextStep->onVerifyFailed_, nextStep->stepCount_);
@@ -103,8 +102,8 @@
 
 void
 KeyChain::onCertificateInterestTimeout
-  (const shared_ptr<const Interest> &interest, int retry, const OnVerifyFailed& onVerifyFailed, const shared_ptr<Data> &data, 
-   shared_ptr<ValidationRequest> nextStep)
+  (const ptr_lib::shared_ptr<const Interest> &interest, int retry, const OnVerifyFailed& onVerifyFailed, const ptr_lib::shared_ptr<Data> &data, 
+   ptr_lib::shared_ptr<ValidationRequest> nextStep)
 {
   if (retry > 0)
     // Issue the same expressInterest as in verifyData except decrement retry.
diff --git a/src/security/policy/no-verify-policy-manager.cpp b/src/security/policy/no-verify-policy-manager.cpp
index 38cc7fd..b93bdb6 100644
--- a/src/security/policy/no-verify-policy-manager.cpp
+++ b/src/security/policy/no-verify-policy-manager.cpp
@@ -9,7 +9,6 @@
 #include <ndn-cpp/security/policy/no-verify-policy-manager.hpp>
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 namespace ndn {
 
@@ -29,12 +28,12 @@
   return false; 
 }
     
-shared_ptr<ValidationRequest>
+ptr_lib::shared_ptr<ValidationRequest>
 NoVerifyPolicyManager::checkVerificationPolicy
-  (const shared_ptr<Data>& data, int stepCount, const OnVerified& onVerified, const OnVerifyFailed& onVerifyFailed)
+  (const ptr_lib::shared_ptr<Data>& data, int stepCount, const OnVerified& onVerified, const OnVerifyFailed& onVerifyFailed)
 { 
   onVerified(data); 
-  return shared_ptr<ValidationRequest>();
+  return ptr_lib::shared_ptr<ValidationRequest>();
 }
 
 bool 
diff --git a/src/security/policy/self-verify-policy-manager.cpp b/src/security/policy/self-verify-policy-manager.cpp
index 025514c..dc4058e 100644
--- a/src/security/policy/self-verify-policy-manager.cpp
+++ b/src/security/policy/self-verify-policy-manager.cpp
@@ -13,7 +13,6 @@
 #include <ndn-cpp/security/policy/self-verify-policy-manager.hpp>
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 namespace ndn {
 
@@ -77,9 +76,9 @@
   return true; 
 }
     
-shared_ptr<ValidationRequest>
+ptr_lib::shared_ptr<ValidationRequest>
 SelfVerifyPolicyManager::checkVerificationPolicy
-  (const shared_ptr<Data>& data, int stepCount, const OnVerified& onVerified, const OnVerifyFailed& onVerifyFailed)
+  (const ptr_lib::shared_ptr<Data>& data, int stepCount, const OnVerified& onVerified, const OnVerifyFailed& onVerifyFailed)
 { 
   // Cast to const Data* so that we use the const version of getSignature() and don't reset the default encoding.
   const Sha256WithRsaSignature *signature = dynamic_cast<const Sha256WithRsaSignature*>(((const Data*)data.get())->getSignature());
@@ -111,7 +110,7 @@
     onVerifyFailed(data); 
   
   // No more steps, so return a null ValidationRequest.
-  return shared_ptr<ValidationRequest>();
+  return ptr_lib::shared_ptr<ValidationRequest>();
 }
 
 bool 
diff --git a/src/security/signature/sha256-with-rsa-handler.cpp b/src/security/signature/sha256-with-rsa-handler.cpp
index 905fc3e..ce6d249 100644
--- a/src/security/signature/sha256-with-rsa-handler.cpp
+++ b/src/security/signature/sha256-with-rsa-handler.cpp
@@ -11,7 +11,6 @@
 #include <ndn-cpp/security/signature/sha256-with-rsa-handler.hpp>
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 namespace ndn {
 
diff --git a/src/sha256-with-rsa-signature.cpp b/src/sha256-with-rsa-signature.cpp
index bf4dfa6..ccf0230 100644
--- a/src/sha256-with-rsa-signature.cpp
+++ b/src/sha256-with-rsa-signature.cpp
@@ -9,14 +9,13 @@
 #include <ndn-cpp/sha256-with-rsa-signature.hpp>
 
 using namespace std;
-using namespace ndn::ptr_lib;
 
 namespace ndn {
 
-shared_ptr<Signature> 
+ptr_lib::shared_ptr<Signature> 
 Sha256WithRsaSignature::clone() const
 {
-  return shared_ptr<Signature>(new Sha256WithRsaSignature(*this));
+  return ptr_lib::shared_ptr<Signature>(new Sha256WithRsaSignature(*this));
 }
 
 void 
