ContentObject and Interest serialization and deserialization seem to
work normal now.  Debug examples added to examples/ folder (they
probably should become a part of test suite).
diff --git a/helper/ccnb-parser/syntax-tree/ccnb-parser-blob.cc b/helper/ccnb-parser/syntax-tree/ccnb-parser-blob.cc
index a0a112c..690f30d 100644
--- a/helper/ccnb-parser/syntax-tree/ccnb-parser-blob.cc
+++ b/helper/ccnb-parser/syntax-tree/ccnb-parser-blob.cc
@@ -37,6 +37,7 @@
     }
   if (i < length && start.IsEnd ())
     throw CcnbDecodingException ();
+  // Block::counter += length;
 }
 
 Blob::~Blob ()
diff --git a/helper/ccnb-parser/syntax-tree/ccnb-parser-block.cc b/helper/ccnb-parser/syntax-tree/ccnb-parser-block.cc
index 2af8aef..d0f795f 100644
--- a/helper/ccnb-parser/syntax-tree/ccnb-parser-block.cc
+++ b/helper/ccnb-parser/syntax-tree/ccnb-parser-block.cc
@@ -36,8 +36,11 @@
 const uint8_t CCN_MAX_TINY= ((1 << (7-CCN_TT_BITS)) - 1);
 const uint8_t CCN_TT_HBIT = ((uint8_t)(1 << 7));
 
+// int Block::counter = 0;
+
 Ptr<Block> Block::ParseBlock (Buffer::Iterator &start)
 {
+  // std::cout << "<< pos: " << counter << "\n";
   uint32_t value = 0;
 
   // We will have problems if length field is more than 32 bits. Though it's really impossible
@@ -47,6 +50,7 @@
       value <<= 8;
       value += byte;
       byte = start.ReadU8 ();
+      // Block::counter ++;
     }
   if (start.IsEnd())
     CcnbDecodingException ();
diff --git a/helper/ccnb-parser/syntax-tree/ccnb-parser-block.h b/helper/ccnb-parser/syntax-tree/ccnb-parser-block.h
index 1ff614b..59ccf02 100644
--- a/helper/ccnb-parser/syntax-tree/ccnb-parser-block.h
+++ b/helper/ccnb-parser/syntax-tree/ccnb-parser-block.h
@@ -46,6 +46,7 @@
 class Block : public SimpleRefCount<Block>
 {
 public:
+  // static int counter;
   /**
    * \brief Parsing stream (recursively) and creating a parsed BLOCK
    * object
diff --git a/helper/ccnb-parser/syntax-tree/ccnb-parser-dtag.cc b/helper/ccnb-parser/syntax-tree/ccnb-parser-dtag.cc
index 8d9ecf7..0fdea06 100644
--- a/helper/ccnb-parser/syntax-tree/ccnb-parser-dtag.cc
+++ b/helper/ccnb-parser/syntax-tree/ccnb-parser-dtag.cc
@@ -29,7 +29,7 @@
 Dtag::Dtag (Buffer::Iterator &start, uint32_t dtag)
 {
   m_dtag = dtag;
-
+  // std::cout << m_dtag << ", position: " << Block::counter << "\n";  
   /**
    * Hack
    *
@@ -66,10 +66,21 @@
 
       m_nestedTags.push_back (Block::ParseBlock (start));
     }
+
+  // hack #3. Stop processing when last tag was <ContentObject>
+  if (m_dtag == CCN_DTAG_ContentObject && // we are in <ContentObject>
+      DynamicCast<Dtag> (m_nestedTags.back())!=0 && // last block is DTAG
+      DynamicCast<Dtag> (m_nestedTags.back())->m_dtag == CCN_DTAG_Content) 
+    {
+      return; 
+    }
+
   if (start.IsEnd ())
       throw CcnbDecodingException ();
 
   start.ReadU8 (); // read CCN_CLOSE
+  // std::cout << "closer, position = " << Block::counter << "\n";
+  // Block::counter ++;
 }
 
 }