diff --git a/src/ccnx-closure.cpp b/src/ccnx-closure.cpp
index 43b0d65..5b24f66 100644
--- a/src/ccnx-closure.cpp
+++ b/src/ccnx-closure.cpp
@@ -6,7 +6,7 @@
               : m_retry(retry), m_timeoutCallback(NULL)
 {
   m_timeoutCallback = new TimeoutCallback (timeoutCallback);
-  m_dataCallback = new DataCallback (dataCallback); 
+  m_dataCallback = new DataCallback (dataCallback);
 }
 
 Closure::Closure(const Closure &other)
@@ -14,7 +14,7 @@
   Closure(other.m_retry, *(other.m_dataCallback), *(other.m_timeoutCallback));
 }
 
-Closure::~Closure () 
+Closure::~Closure ()
 {
   delete m_dataCallback;
   delete m_timeoutCallback;
@@ -22,20 +22,20 @@
   m_timeoutCallback = NULL;
 }
 
-Closure::TimeoutCallbackReturnValue 
+Closure::TimeoutCallbackReturnValue
 Closure::runTimeoutCallback(const string &interest)
 {
   if ((*m_timeoutCallback).empty())
   {
     return RESULT_OK;
   }
-  
+
   return (*m_timeoutCallback)(interest);
 }
 
 
-void 
-Closure::runDataCallback(const string &name, const Bytes &content) 
+void
+Closure::runDataCallback(const string &name, const Bytes &content)
 {
   if (m_dataCallback != NULL) {
     (*m_dataCallback)(name, content);
diff --git a/src/ccnx-pco.cpp b/src/ccnx-pco.cpp
index df3bd06..1c24891 100644
--- a/src/ccnx-pco.cpp
+++ b/src/ccnx-pco.cpp
@@ -21,7 +21,7 @@
 
 ParsedContentObject::ParsedContentObject(const ParsedContentObject &other)
 {
-  ParsedContentObject(other.m_bytes); 
+  ParsedContentObject(other.m_bytes);
 }
 
 ParsedContentObject::~ParsedContentObject()
diff --git a/src/ccnx-tunnel.cpp b/src/ccnx-tunnel.cpp
index 281079f..06adae0 100644
--- a/src/ccnx-tunnel.cpp
+++ b/src/ccnx-tunnel.cpp
@@ -11,12 +11,12 @@
   refreshLocalPrefix();
 }
 
-CcnxTunnel::~CcnxTunnel() 
+CcnxTunnel::~CcnxTunnel()
 {
 }
 
 void
-CcnxTunnel::refreshLocalPrefix() 
+CcnxTunnel::refreshLocalPrefix()
 {
   string newPrefix = getLocalPrefix();
   if (!newPrefix.empty() && m_localPrefix != newPrefix)
@@ -36,7 +36,7 @@
   sendInterest(tunneledInterest, cp);
 }
 
-void 
+void
 CcnxTunnel::handleTunneledData(const string &name, const Bytes &tunneledData, const Closure::DataCallback &originalDataCallback)
 {
   ParsedContentObject pco(tunneledData);
@@ -48,7 +48,7 @@
 {
   Bytes content = createContentObject(name, buf, len, freshness);
   storeContentObject(name, content);
-  
+
   return publishContentObject(name, content, freshness);
 }
 
@@ -64,12 +64,12 @@
 CcnxTunnel::handleTunneledInterest(const string &tunneledInterest)
 {
   // The interest must have m_localPrefix as a prefix (component-wise), otherwise ccnd would not deliver it to us
-  string interest = (m_localPrefix == "/") 
+  string interest = (m_localPrefix == "/")
                     ? tunneledInterest
                     : tunneledInterest.substr(m_localPrefix.size());
 
-  ReadLock(m_ritLock); 
-  
+  ReadLock(m_ritLock);
+
   // This is linear scan, but should be acceptable under the assumption that the caller wouldn't be listening to a lot prefixes (as of now, most app listen to one or two prefixes)
   for (RitIter it = m_rit.begin(); it != m_rit.end(); it++)
   {
@@ -84,7 +84,7 @@
 bool
 CcnxTunnel::isPrefix(const string &prefix, const string &name)
 {
-  // prefix is literally prefix of name 
+  // prefix is literally prefix of name
   if (name.find(prefix) == 0)
   {
     // name and prefix are exactly the same, or the next character in name
@@ -97,7 +97,7 @@
   return false;
 }
 
-int 
+int
 CcnxTunnel::setInterestFilter(const string &prefix, const InterestCallback &interestCallback)
 {
   WriteLock(m_ritLock);
@@ -106,7 +106,7 @@
   return 0;
 }
 
-void 
+void
 CcnxTunnel::clearInterestFilter(const string &prefix)
 {
   WriteLock(m_ritLock);
@@ -127,7 +127,7 @@
 {
 }
 
-void 
+void
 TunnelClosure::runDataCallback(const string &name, const Bytes &content)
 {
   if (m_tunnel != NULL)
diff --git a/src/ccnx-wrapper.cpp b/src/ccnx-wrapper.cpp
index 041665e..d84dc0d 100644
--- a/src/ccnx-wrapper.cpp
+++ b/src/ccnx-wrapper.cpp
@@ -22,7 +22,7 @@
   if (len > 0)
   {
     bytes.resize(len);
-    memcpy(&bytes[0], src, len); 
+    memcpy(&bytes[0], src, len);
   }
 }
 
@@ -64,7 +64,7 @@
     ccn_disconnect (m_handle);
     ccn_destroy (&m_handle);
   }
-  
+
   m_handle = ccn_create ();
   if (ccn_connect(m_handle, NULL) < 0)
   {
@@ -88,7 +88,7 @@
     UniqueRecLock(m_mutex);
     m_running = false;
   }
-  
+
   m_thread.join ();
   ccn_disconnect (m_handle);
   ccn_destroy (&m_handle);
@@ -154,7 +154,7 @@
           }
 
           if (!m_running) break;
-        
+
           if (res < 0)
             BOOST_THROW_EXCEPTION (CcnxOperationException()
                                  << errmsg_info_str("ccn_run returned error"));
@@ -163,13 +163,13 @@
           pollfd pfds[1];
           {
             UniqueRecLock(m_mutex);
-          
+
             pfds[0].fd = ccn_get_connection_fd (m_handle);
             pfds[0].events = POLLIN;
             if (ccn_output_is_pending (m_handle))
               pfds[0].events |= POLLOUT;
           }
-        
+
           int ret = poll (pfds, 1, 1);
           if (ret < 0)
             {
@@ -216,9 +216,9 @@
           }
         catch (...)
           {
-            cout << "UNKNOWN EXCEPTION !!!" << endl; 
+            cout << "UNKNOWN EXCEPTION !!!" << endl;
           }
-     } 
+     }
 }
 
 Bytes
@@ -260,7 +260,7 @@
   UniqueRecLock(m_mutex);
   if (!m_running || !m_connected)
     return -1;
-  
+
 
   if (ccn_put(m_handle, head(contentObject), contentObject.size()) < 0)
   {
@@ -273,7 +273,7 @@
 int
 CcnxWrapper::publishData (const string &name, const unsigned char *buf, size_t len, int freshness)
 {
-  Bytes co = createContentObject(name, buf, len, freshness); 
+  Bytes co = createContentObject(name, buf, len, freshness);
   return putToCcnd(co);
 }
 
@@ -391,7 +391,7 @@
   UniqueRecLock(m_mutex);
   if (!m_running || !m_connected)
     return -1;
-  
+
   ccn_charbuf *pname = ccn_charbuf_create();
   ccn_closure *dataClosure = new ccn_closure;
 
@@ -456,9 +456,9 @@
     {
       return "";
     }
-  
+
   string retval = "";
-  
+
   struct ccn_charbuf *templ = ccn_charbuf_create();
   ccn_charbuf_append_tt(templ, CCN_DTAG_Interest, CCN_DTAG);
   ccn_charbuf_append_tt(templ, CCN_DTAG_Name, CCN_DTAG);
@@ -477,9 +477,9 @@
   else
     {
       struct ccn_fetch *fetch = ccn_fetch_new (tmp_handle);
-      
+
       struct ccn_fetch_stream *stream = ccn_fetch_open (fetch, name, "/local/ndn/prefix",
-                                                        NULL, 4, CCN_V_HIGHEST, 0);      
+                                                        NULL, 4, CCN_V_HIGHEST, 0);
       if (stream == NULL) {
       }
       else
@@ -490,11 +490,11 @@
           char buf[256];
           while (true) {
             res = ccn_fetch_read (stream, buf, sizeof(buf));
-            
+
             if (res == 0) {
               break;
             }
-            
+
             if (res > 0) {
               os << string(buf, res);
             } else if (res == CCN_FETCH_READ_NONE) {
@@ -525,7 +525,7 @@
 
   ccn_disconnect (tmp_handle);
   ccn_destroy (&tmp_handle);
-  
+
   return retval;
 }
 
