diff --git a/tests/test_socket.cc b/tests/test_socket.cc
index cc6e56b..fd17c44 100644
--- a/tests/test_socket.cc
+++ b/tests/test_socket.cc
@@ -46,6 +46,10 @@
 
 class TestSocketApp {
 public:
+  TestSocketApp()
+    : sum(0)
+  {}
+
   map<ndn::Name, string> data;
   void set(const ndn::shared_ptr<const ndn::Data>& dataPacket) {
     // _LOG_FUNCTION (this << ", " << str1);
@@ -62,7 +66,7 @@
   
   void setNum(const ndn::shared_ptr<const ndn::Data>& dataPacket) {
     int n = dataPacket->getContent().value_size() / 4;
-    int *numbers = new int [n];
+    uint32_t *numbers = new uint32_t [n];
     memcpy(numbers, dataPacket->getContent().value(), dataPacket->getContent().value_size());
     for (int i = 0; i < n; i++) {
       sum += numbers[i];
@@ -81,7 +85,7 @@
     delete numbers;
   }
 
-  int sum;
+  uint32_t sum;
 
   void fetchAll(const vector<MissingDataInfo> &v, SyncSocket *socket) {
     int n = v.size();
@@ -101,9 +105,9 @@
 
     PRINT
 
-    std::cout << "In fetchNumbers. size of v is:  " << n << std::endl;
+    // std::cout << "In fetchNumbers. size of v is:  " << n << std::endl;
     for (int i = 0; i < n; i++) {
-      std::cout << "In fetchNumbers. v[i].low is (" <<v[i].low.getSession() <<", " << v[i].low.getSeq() << ") v[i].high is ("<<v[i].high.getSession() <<", " <<v[i].high.getSeq()<<")" << std::endl;
+      // std::cout << "In fetchNumbers. v[i].low is (" <<v[i].low.getSession() <<", " << v[i].low.getSeq() << ") v[i].high is ("<<v[i].high.getSession() <<", " <<v[i].high.getSeq()<<")" << std::endl;
       for(SeqNo s = v[i].low; s <= v[i].high; ++s) {
         PRINT
         socket->fetchData(v[i].prefix, s, bind(&TestSocketApp::setNum, this, _1));
@@ -222,11 +226,17 @@
   void
   check(int round)
   { 
-    cout << "++++++++++++++++++ " << round << " " << m_a1.toString() << endl;
     BOOST_CHECK_EQUAL(m_a1.toString(), m_a2.toString());
     BOOST_CHECK_EQUAL(m_a2.toString(), m_a3.toString());
   }
 
+  void
+  done()
+  {
+    m_s1.reset();
+    m_s2.reset();
+    m_s3.reset();
+  }
 
 
   TestSocketApp m_a1, m_a2, m_a3;
@@ -297,10 +307,19 @@
   void
   check(int num)
   { 
+    _LOG_DEBUG ("codnum " << num);
+    _LOG_DEBUG ("a1 sum " << m_a1.sum);
+    _LOG_DEBUG ("a2 sum " << m_a2.sum);
+
     BOOST_CHECK(m_a1.sum == m_a2.sum && m_a1.sum == num);
   }
 
-
+  void
+  done()
+  {
+    m_s1.reset();
+    m_s2.reset();
+  }
 
   TestSocketApp m_a1, m_a2;
   ndn::shared_ptr<ndn::ValidatorNull> m_validator;
@@ -335,21 +354,23 @@
   string data3 = "You surf the Internet, I surf the real world";
   string data4 = "I got a fortune cookie once that said 'You like Chinese food'";
   string data5 = "Real men wear pink. Why? Because their wives make them";
-  scheduler.scheduleEvent(ndn::time::seconds(2.18), ndn::bind(&TestSet1::publishSocket3, &testSet1, 0, data3));
-  scheduler.scheduleEvent(ndn::time::seconds(2.20), ndn::bind(&TestSet1::publishSocket2, &testSet1, 0, data4));
-  scheduler.scheduleEvent(ndn::time::seconds(2.21), ndn::bind(&TestSet1::publishSocket2, &testSet1, 0, data5));
-  scheduler.scheduleEvent(ndn::time::seconds(3.21), ndn::bind(&TestSet1::setSocket3, &testSet1, "/0/0", data3));
-  scheduler.scheduleEvent(ndn::time::seconds(3.22), ndn::bind(&TestSet1::setSocket2, &testSet1, "/0/0", data4));
-  scheduler.scheduleEvent(ndn::time::seconds(3.23), ndn::bind(&TestSet1::setSocket2, &testSet1, "/0/1", data5));
+  scheduler.scheduleEvent(ndn::time::seconds(3.18), ndn::bind(&TestSet1::publishSocket3, &testSet1, 0, data3));
+  scheduler.scheduleEvent(ndn::time::seconds(3.20), ndn::bind(&TestSet1::publishSocket2, &testSet1, 0, data4));
+  scheduler.scheduleEvent(ndn::time::seconds(3.21), ndn::bind(&TestSet1::publishSocket2, &testSet1, 0, data5));
+  scheduler.scheduleEvent(ndn::time::seconds(4.21), ndn::bind(&TestSet1::setSocket3, &testSet1, "/0/0", data3));
+  scheduler.scheduleEvent(ndn::time::seconds(4.22), ndn::bind(&TestSet1::setSocket2, &testSet1, "/0/0", data4));
+  scheduler.scheduleEvent(ndn::time::seconds(4.23), ndn::bind(&TestSet1::setSocket2, &testSet1, "/0/1", data5));
+  scheduler.scheduleEvent(ndn::time::seconds(4.30), ndn::bind(&TestSet1::check, &testSet1, 3));
   // not sure weither this is simultanous data generation from multiple sources
   _LOG_DEBUG ("Simultaneous publishing");
   string data6 = "Shakespeare says: 'Prose before hos.'";
   string data7 = "Pick good people, talent never wears out";
-  scheduler.scheduleEvent(ndn::time::seconds(3.30), ndn::bind(&TestSet1::publishSocket1, &testSet1, 0, data6));
-  scheduler.scheduleEvent(ndn::time::seconds(3.30), ndn::bind(&TestSet1::publishSocket2, &testSet1, 0, data7));
-  scheduler.scheduleEvent(ndn::time::seconds(4.80), ndn::bind(&TestSet1::setSocket1, &testSet1, "/0/3", data6));
-  scheduler.scheduleEvent(ndn::time::seconds(4.80), ndn::bind(&TestSet1::setSocket2, &testSet1, "/0/2", data7));
-  scheduler.scheduleEvent(ndn::time::seconds(4.90), ndn::bind(&TestSet1::check, &testSet1, 3));
+  scheduler.scheduleEvent(ndn::time::seconds(5.50), ndn::bind(&TestSet1::publishSocket1, &testSet1, 0, data6));
+  scheduler.scheduleEvent(ndn::time::seconds(5.50), ndn::bind(&TestSet1::publishSocket2, &testSet1, 0, data7));
+  scheduler.scheduleEvent(ndn::time::seconds(6.80), ndn::bind(&TestSet1::setSocket1, &testSet1, "/0/3", data6));
+  scheduler.scheduleEvent(ndn::time::seconds(6.80), ndn::bind(&TestSet1::setSocket2, &testSet1, "/0/2", data7));
+  scheduler.scheduleEvent(ndn::time::seconds(6.90), ndn::bind(&TestSet1::check, &testSet1, 4));
+  scheduler.scheduleEvent(ndn::time::seconds(7.00), ndn::bind(&TestSet1::done, &testSet1));
 
   ioService->run();
 }
@@ -362,16 +383,17 @@
 
   scheduler.scheduleEvent(ndn::time::seconds(0.00), ndn::bind(&TestSet2::createSyncSocket1, &testSet2));
   scheduler.scheduleEvent(ndn::time::seconds(0.05), ndn::bind(&TestSet2::createSyncSocket2, &testSet2));
-  int num[5] = {0, 1, 2, 3, 4};
+  uint32_t num[5] = {0, 1, 2, 3, 4};
   string data0((const char *) num, sizeof(num));
   scheduler.scheduleEvent(ndn::time::seconds(0.10), ndn::bind(&TestSet2::publishSocket1, &testSet2, 0, data0));
   scheduler.scheduleEvent(ndn::time::seconds(0.15), ndn::bind(&TestSet2::setSocket1, &testSet2, (const char *) num, sizeof (num)));
   scheduler.scheduleEvent(ndn::time::seconds(1.00), ndn::bind(&TestSet2::check, &testSet2, 10));
-  int newNum[5] = {9, 7, 2, 1, 1};
+  uint32_t newNum[5] = {9, 7, 2, 1, 1};
   string data1((const char *) newNum, sizeof(newNum));
   scheduler.scheduleEvent(ndn::time::seconds(1.10), ndn::bind(&TestSet2::publishSocket2, &testSet2, 0, data1));
   scheduler.scheduleEvent(ndn::time::seconds(1.15), ndn::bind(&TestSet2::setSocket2, &testSet2, (const char *) newNum, sizeof (newNum)));
   scheduler.scheduleEvent(ndn::time::seconds(2.00), ndn::bind(&TestSet2::check, &testSet2, 30));
+  scheduler.scheduleEvent(ndn::time::seconds(7.00), ndn::bind(&TestSet2::done, &testSet2));
 
   ioService->run();
 }
