diff --git a/extras/libmemif/dockerfile b/extras/libmemif/dockerfile
index 92b2d2a..5475c6b 100644
--- a/extras/libmemif/dockerfile
+++ b/extras/libmemif/dockerfile
@@ -6,7 +6,7 @@
 
 RUN git clone https://github.com/JakubGrajciar/libmemif.git /libmemif
 WORKDIR /libmemif
-RUN git checkout dev
+RUN git checkout master
 RUN ./bootstrap
 RUN ./configure
 RUN make
diff --git a/extras/libmemif/src/main.c b/extras/libmemif/src/main.c
index 49bf50c..4942767 100644
--- a/extras/libmemif/src/main.c
+++ b/extras/libmemif/src/main.c
@@ -181,7 +181,7 @@
     }
   printf ("\n\n");
 }
-#endif /* MEMIF_DBG */
+#endif /* MEMIF_DBG_SHM */
 
 int
 memif_syscall_error_handler (int err_code)
@@ -512,8 +512,8 @@
   if (conn == NULL)
     return MEMIF_ERR_NOCONN;
   uint8_t num =
-    (conn->args.is_master) ? conn->run_args.num_s2m_rings : conn->
-    run_args.num_m2s_rings;
+    (conn->args.is_master) ? conn->run_args.num_s2m_rings : conn->run_args.
+    num_m2s_rings;
   if (qid >= num)
     return MEMIF_ERR_QID;
 
@@ -842,20 +842,21 @@
 	  if (((memif_connection_t *) e->data_struct)->on_interrupt != NULL)
 	    {
 	      num =
-		(((memif_connection_t *) e->data_struct)->
-		 args.is_master) ? ((memif_connection_t *) e->
-				    data_struct)->run_args.
-		num_s2m_rings : ((memif_connection_t *) e->data_struct)->
-		run_args.num_m2s_rings;
+		(((memif_connection_t *) e->data_struct)->args.
+		 is_master) ? ((memif_connection_t *) e->data_struct)->
+		run_args.num_s2m_rings : ((memif_connection_t *) e->
+					  data_struct)->run_args.
+		num_m2s_rings;
 	      for (i = 0; i < num; i++)
 		{
-		  if (((memif_connection_t *) e->data_struct)->
-		      rx_queues[i].int_fd == fd)
+		  if (((memif_connection_t *) e->data_struct)->rx_queues[i].
+		      int_fd == fd)
 		    {
-		      ((memif_connection_t *) e->data_struct)->
-			on_interrupt ((void *) e->data_struct,
-				      ((memif_connection_t *) e->
-				       data_struct)->private_ctx, i);
+		      ((memif_connection_t *) e->
+		       data_struct)->on_interrupt ((void *) e->data_struct,
+						   ((memif_connection_t *)
+						    e->data_struct)->
+						   private_ctx, i);
 		      return MEMIF_ERR_SUCCESS;
 		    }
 		}
@@ -882,24 +883,24 @@
 	  if (events & MEMIF_FD_EVENT_READ)
 	    {
 	      err =
-		((memif_connection_t *) e->data_struct)->
-		read_fn (e->data_struct);
+		((memif_connection_t *) e->data_struct)->read_fn (e->
+								  data_struct);
 	      if (err != MEMIF_ERR_SUCCESS)
 		return err;
 	    }
 	  if (events & MEMIF_FD_EVENT_WRITE)
 	    {
 	      err =
-		((memif_connection_t *) e->data_struct)->
-		write_fn (e->data_struct);
+		((memif_connection_t *) e->data_struct)->write_fn (e->
+								   data_struct);
 	      if (err != MEMIF_ERR_SUCCESS)
 		return err;
 	    }
 	  if (events & MEMIF_FD_EVENT_ERROR)
 	    {
 	      err =
-		((memif_connection_t *) e->data_struct)->
-		error_fn (e->data_struct);
+		((memif_connection_t *) e->data_struct)->error_fn (e->
+								   data_struct);
 	      if (err != MEMIF_ERR_SUCCESS)
 		return err;
 	    }
@@ -993,8 +994,8 @@
   if (c->tx_queues != NULL)
     {
       num =
-	(c->args.is_master) ? c->run_args.num_m2s_rings : c->
-	run_args.num_s2m_rings;
+	(c->args.is_master) ? c->run_args.num_m2s_rings : c->run_args.
+	num_s2m_rings;
       for (i = 0; i < num; i++)
 	{
 	  mq = &c->tx_queues[i];
@@ -1014,8 +1015,8 @@
   if (c->rx_queues != NULL)
     {
       num =
-	(c->args.is_master) ? c->run_args.num_s2m_rings : c->
-	run_args.num_m2s_rings;
+	(c->args.is_master) ? c->run_args.num_s2m_rings : c->run_args.
+	num_m2s_rings;
       for (i = 0; i < num; i++)
 	{
 	  mq = &c->rx_queues[i];
@@ -1167,8 +1168,8 @@
     }
 
   num =
-    (c->args.is_master) ? c->run_args.num_m2s_rings : c->
-    run_args.num_s2m_rings;
+    (c->args.is_master) ? c->run_args.num_m2s_rings : c->run_args.
+    num_s2m_rings;
   for (i = 0; i < num; i++)
     {
       mq = &c->tx_queues[i];
@@ -1185,8 +1186,8 @@
 	}
     }
   num =
-    (c->args.is_master) ? c->run_args.num_s2m_rings : c->
-    run_args.num_m2s_rings;
+    (c->args.is_master) ? c->run_args.num_s2m_rings : c->run_args.
+    num_m2s_rings;
   for (i = 0; i < num; i++)
     {
       mq = &c->rx_queues[i];
@@ -1347,8 +1348,8 @@
   if (c->fd < 0)
     return MEMIF_ERR_DISCONNECTED;
   uint8_t num =
-    (c->args.is_master) ? c->run_args.num_m2s_rings : c->
-    run_args.num_s2m_rings;
+    (c->args.is_master) ? c->run_args.num_m2s_rings : c->run_args.
+    num_s2m_rings;
   if (qid >= num)
     return MEMIF_ERR_QID;
   memif_queue_t *mq = &c->tx_queues[qid];
@@ -1377,7 +1378,7 @@
     {
       while ((count > 2) && (ns > 2))
 	{
-	  s0 = (ring->head + mq->alloc_bufs + *count_out) & mask;
+	  s0 = (ring->head + mq->alloc_bufs) & mask;
 	  chain_buf0 = size / ring->desc[s0].buffer_length;
 	  if (((size % ring->desc[s0].buffer_length) != 0) || (size == 0))
 	    chain_buf0++;
@@ -1385,7 +1386,7 @@
 	  if (chain_buf0 > ns)
 	    break;
 
-	  s1 = (ring->head + mq->alloc_bufs + *count_out + chain_buf0) & mask;
+	  s1 = (ring->head + mq->alloc_bufs + chain_buf0) & mask;
 	  chain_buf1 = size / ring->desc[s1].buffer_length;
 	  if (((size % ring->desc[s1].buffer_length) != 0) || (size == 0))
 	    chain_buf1++;
@@ -1398,6 +1399,8 @@
 
 	  b0->desc_index = s0;
 	  b1->desc_index = s1;
+	  ring->desc[s0].flags = 0;
+	  ring->desc[s1].flags = 0;
 	  b0->buffer_len = ring->desc[s0].buffer_length * chain_buf0;
 	  b1->buffer_len = ring->desc[s1].buffer_length * chain_buf1;
 	  /* TODO: support multiple regions -> ring descriptor contains region index */
@@ -1429,7 +1432,7 @@
 	  ns -= chain_buf0 + chain_buf1;
 	  *count_out += 2;
 	}
-      s0 = (ring->head + mq->alloc_bufs + *count_out) & mask;
+      s0 = (ring->head + mq->alloc_bufs) & mask;
 
       b0 = (bufs + *count_out);
 
@@ -1441,6 +1444,7 @@
 	break;
 
       b0->desc_index = s0;
+      ring->desc[s0].flags = 0;
       b0->buffer_len = ring->desc[s0].buffer_length * chain_buf0;
       b0->data = c->regions->shm + ring->desc[s0].offset;
 
@@ -1481,8 +1485,8 @@
   if (c->fd < 0)
     return MEMIF_ERR_DISCONNECTED;
   uint8_t num =
-    (c->args.is_master) ? c->run_args.num_s2m_rings : c->
-    run_args.num_m2s_rings;
+    (c->args.is_master) ? c->run_args.num_s2m_rings : c->run_args.
+    num_m2s_rings;
   if (qid >= num)
     return MEMIF_ERR_QID;
   libmemif_main_t *lm = &libmemif_main;
@@ -1513,7 +1517,6 @@
 	  if ((b1->buffer_len % ring->desc[b1->desc_index].buffer_length) !=
 	      0)
 	    chain_buf1++;
-	  tail = (b0->desc_index + chain_buf0) & mask;
 	  tail = (b1->desc_index + chain_buf1) & mask;
 	  b0->data = NULL;
 	  b1->data = NULL;
@@ -1535,6 +1538,7 @@
     }
   MEMIF_MEORY_BARRIER ();
   ring->tail = tail;
+  DBG ("tail: %u", ring->tail);
 
   return MEMIF_ERR_SUCCESS;	/* 0 */
 }
@@ -1549,8 +1553,8 @@
   if (c->fd < 0)
     return MEMIF_ERR_DISCONNECTED;
   uint8_t num =
-    (c->args.is_master) ? c->run_args.num_m2s_rings : c->
-    run_args.num_s2m_rings;
+    (c->args.is_master) ? c->run_args.num_m2s_rings : c->run_args.
+    num_s2m_rings;
   if (qid >= num)
     return MEMIF_ERR_QID;
   memif_queue_t *mq = &c->tx_queues[qid];
@@ -1583,8 +1587,34 @@
 
 	  for (i = 0; i < memif_min (chain_buf0, chain_buf1); i++)
 	    {
-	      ring->desc[(b0->desc_index + i) & mask].length = b0->data_len;
-	      ring->desc[(b1->desc_index + i) & mask].length = b1->data_len;
+	      /* b0 */
+	      if (b0->data_len >
+		  ring->desc[(b0->desc_index + i) & mask].buffer_length)
+		{
+		  b0->data_len -=
+		    ring->desc[(b0->desc_index + i) & mask].length =
+		    ring->desc[(b0->desc_index + i) & mask].buffer_length;
+		}
+	      else
+		{
+		  ring->desc[(b0->desc_index + i) & mask].length =
+		    b0->data_len;
+		  b0->data_len = 0;
+		}
+	      /* b1 */
+	      if (b1->data_len >
+		  ring->desc[(b1->desc_index + i) & mask].buffer_length)
+		{
+		  b1->data_len -=
+		    ring->desc[(b1->desc_index + i) & mask].length =
+		    ring->desc[(b1->desc_index + i) & mask].buffer_length;
+		}
+	      else
+		{
+		  ring->desc[(b1->desc_index + i) & mask].length =
+		    b1->data_len;
+		  b1->data_len = 0;
+		}
 #ifdef MEMIF_DBG_SHM
 	      print_bytes (b0->data +
 			   ring->desc[(b0->desc_index +
@@ -1598,15 +1628,26 @@
 			   (chain_buf1 - 1),
 			   ring->desc[(b1->desc_index +
 				       i) & mask].buffer_length, DBG_TX_BUF);
-#endif
+#endif /* MEMIF_DBG_SHM */
 	    }
 
 	  if (chain_buf0 > chain_buf1)
 	    {
 	      for (; i < chain_buf0; i++)
 		{
-		  ring->desc[(b0->desc_index + i) & mask].length =
-		    b0->data_len;
+		  if (b0->data_len >
+		      ring->desc[(b0->desc_index + i) & mask].buffer_length)
+		    {
+		      b0->data_len -=
+			ring->desc[(b0->desc_index + i) & mask].length =
+			ring->desc[(b0->desc_index + i) & mask].buffer_length;
+		    }
+		  else
+		    {
+		      ring->desc[(b0->desc_index + i) & mask].length =
+			b0->data_len;
+		      b0->data_len = 0;
+		    }
 #ifdef MEMIF_DBG_SHM
 		  print_bytes (b0->data +
 			       ring->desc[(b0->desc_index +
@@ -1615,14 +1656,26 @@
 			       ring->desc[(b0->desc_index +
 					   i) & mask].buffer_length,
 			       DBG_TX_BUF);
-#endif
+#endif /* MEMIF_DBG_SHM */
 		}
 	    }
 	  else
 	    {
 	      for (; i < chain_buf1; i++)
 		{
-		  ring->desc[b1->desc_index + i].length = b1->data_len;
+		  if (b1->data_len >
+		      ring->desc[(b1->desc_index + i) & mask].buffer_length)
+		    {
+		      b1->data_len -=
+			ring->desc[(b1->desc_index + i) & mask].length =
+			ring->desc[(b1->desc_index + i) & mask].buffer_length;
+		    }
+		  else
+		    {
+		      ring->desc[(b1->desc_index + i) & mask].length =
+			b1->data_len;
+		      b1->data_len = 0;
+		    }
 #ifdef MEMIF_DBG_SHM
 		  print_bytes (b1->data +
 			       ring->desc[(b1->desc_index +
@@ -1631,44 +1684,62 @@
 			       ring->desc[(b1->desc_index +
 					   i) & mask].buffer_length,
 			       DBG_TX_BUF);
-#endif
+#endif /* MEMIF_DBG_SHM */
 		}
 	    }
 
-	  head = (b0->desc_index + chain_buf0) & mask;
 	  head = (b1->desc_index + chain_buf1) & mask;
 
 	  b0->data = NULL;
-	  b0->data_len = 0;
+#ifdef MEMIF_DBG
+	  if (b0->data_len != 0)
+	    DBG ("invalid b0 data length!");
+#endif /* MEMIF_DBG */
 	  b1->data = NULL;
-	  b1->data_len = 0;
+#ifdef MEMIF_DBG
+	  if (b1->data_len != 0)
+	    DBG ("invalid b1 data length!");
+#endif /* MEMIF_DBG */
 
 	  count -= 2;
 	  *tx += chain_buf0 + chain_buf1;
 	  curr_buf += 2;
 	}
 
-      b0 = (bufs + *tx);
+      b0 = (bufs + curr_buf);
       chain_buf0 = b0->buffer_len / ring->desc[b0->desc_index].buffer_length;
       if ((b0->buffer_len % ring->desc[b0->desc_index].buffer_length) != 0)
 	chain_buf0++;
 
       for (i = 0; i < chain_buf0; i++)
 	{
-	  ring->desc[(b0->desc_index + i) & mask].length = b0->data_len;
+	  if (b0->data_len >
+	      ring->desc[(b0->desc_index + i) & mask].buffer_length)
+	    {
+	      b0->data_len -= ring->desc[(b0->desc_index + i) & mask].length =
+		ring->desc[(b0->desc_index + i) & mask].buffer_length;
+	    }
+	  else
+	    {
+	      ring->desc[(b0->desc_index + i) & mask].length = b0->data_len;
+	      b0->data_len = 0;
+	    }
 #ifdef MEMIF_DBG_SHM
 	  print_bytes (b0->data +
 		       ring->desc[(b0->desc_index + i) & mask].buffer_length *
 		       (chain_buf0 - 1),
 		       ring->desc[(b0->desc_index + i) & mask].buffer_length,
 		       DBG_TX_BUF);
-#endif
+#endif /* MEMIF_DBG_SHM */
 	}
 
       head = (b0->desc_index + chain_buf0) & mask;
 
       b0->data = NULL;
-      b0->data_len = 0;
+#ifdef MEMIF_DBG
+      if (b0->data_len != 0)
+	DBG ("invalid b0 data length!");
+#endif /* MEMIF_DBG */
 
       count--;
       *tx += chain_buf0;
@@ -1703,8 +1774,8 @@
   if (c->fd < 0)
     return MEMIF_ERR_DISCONNECTED;
   uint8_t num =
-    (c->args.is_master) ? c->run_args.num_s2m_rings : c->
-    run_args.num_m2s_rings;
+    (c->args.is_master) ? c->run_args.num_s2m_rings : c->run_args.
+    num_m2s_rings;
   if (qid >= num)
     return MEMIF_ERR_QID;
   memif_queue_t *mq = &c->rx_queues[qid];
@@ -1732,6 +1803,7 @@
 
   while (ns && count)
     {
+      DBG ("ns: %u, count: %u", ns, count);
       while ((ns > 2) && (count > 2))
 	{
 	  b0 = (bufs + curr_buf);
@@ -1739,41 +1811,67 @@
 
 	  b0->desc_index = mq->last_head;
 	  i = 0;
-	  do
+	  b0->data_len = 0;
+	  b0->buffer_len = 0;
+
+	  b0->data = memif_get_buffer (conn, ring, mq->last_head);
+	  b0->data_len += ring->desc[mq->last_head].length;
+	  b0->buffer_len += ring->desc[mq->last_head].buffer_length;
+#ifdef MEMIF_DBG_SHM
+	  print_bytes (b0->data +
+		       ring->desc[b0->desc_index].buffer_length * i++,
+		       ring->desc[b0->desc_index].buffer_length, DBG_TX_BUF);
+#endif /* MEMIF_DBG_SHM */
+	  ns--;
+	  *rx += 1;
+	  while (ring->desc[mq->last_head].flags & MEMIF_DESC_FLAG_NEXT)
 	    {
-	      b0->data = memif_get_buffer (conn, ring, mq->last_head);
-	      b0->data_len = ring->desc[mq->last_head].length;
-	      b0->buffer_len = ring->desc[mq->last_head].buffer_length;
+	      ring->desc[mq->last_head].flags &= ~MEMIF_DESC_FLAG_NEXT;
+	      mq->last_head = (mq->last_head + 1) & mask;
+	      b0->data_len += ring->desc[mq->last_head].length;
+	      b0->buffer_len += ring->desc[mq->last_head].buffer_length;
 #ifdef MEMIF_DBG_SHM
 	      print_bytes (b0->data +
 			   ring->desc[b0->desc_index].buffer_length * i++,
 			   ring->desc[b0->desc_index].buffer_length,
 			   DBG_TX_BUF);
-#endif
-	      mq->last_head = (mq->last_head + 1) & mask;
+#endif /* MEMIF_DBG_SHM */
 	      ns--;
 	      *rx += 1;
 	    }
-	  while (ring->desc[mq->last_head].flags & MEMIF_DESC_FLAG_NEXT);
+	  mq->last_head = (mq->last_head + 1) & mask;
 
 	  b1->desc_index = mq->last_head;
 	  i = 0;
-	  do
+	  b0->data_len = 0;
+	  b0->buffer_len = 0;
+
+	  b1->data = memif_get_buffer (conn, ring, mq->last_head);
+	  b1->data_len += ring->desc[mq->last_head].length;
+	  b1->buffer_len += ring->desc[mq->last_head].buffer_length;
+#ifdef MEMIF_DBG_SHM
+	  print_bytes (b1->data +
+		       ring->desc[b1->desc_index].buffer_length * i++,
+		       ring->desc[b1->desc_index].buffer_length, DBG_TX_BUF);
+#endif /* MEMIF_DBG_SHM */
+	  ns--;
+	  *rx += 1;
+	  while (ring->desc[mq->last_head].flags & MEMIF_DESC_FLAG_NEXT)
 	    {
-	      b1->data = memif_get_buffer (conn, ring, mq->last_head);
-	      b1->data_len = ring->desc[mq->last_head].length;
-	      b1->buffer_len = ring->desc[mq->last_head].buffer_length;
+	      ring->desc[mq->last_head].flags &= ~MEMIF_DESC_FLAG_NEXT;
+	      mq->last_head = (mq->last_head + 1) & mask;
+	      b1->data_len += ring->desc[mq->last_head].length;
+	      b1->buffer_len += ring->desc[mq->last_head].buffer_length;
 #ifdef MEMIF_DBG_SHM
 	      print_bytes (b1->data +
 			   ring->desc[b1->desc_index].buffer_length * i++,
 			   ring->desc[b1->desc_index].buffer_length,
 			   DBG_TX_BUF);
-#endif
-	      mq->last_head = (mq->last_head + 1) & mask;
+#endif /* MEMIF_DBG_SHM */
 	      ns--;
 	      *rx += 1;
 	    }
-	  while (ring->desc[mq->last_head].flags & MEMIF_DESC_FLAG_NEXT);
+	  mq->last_head = (mq->last_head + 1) & mask;
 
 	  count -= 2;
 	  curr_buf += 2;
@@ -1782,21 +1880,35 @@
 
       b0->desc_index = mq->last_head;
       i = 0;
-      do
+      b0->data_len = 0;
+      b0->buffer_len = 0;
+
+      b0->data = memif_get_buffer (conn, ring, mq->last_head);
+      b0->data_len += ring->desc[mq->last_head].length;
+      b0->buffer_len += ring->desc[mq->last_head].buffer_length;
+#ifdef MEMIF_DBG_SHM
+      print_bytes (b0->data +
+		   ring->desc[b0->desc_index].buffer_length * i++,
+		   ring->desc[b0->desc_index].buffer_length, DBG_TX_BUF);
+#endif /* MEMIF_DBG_SHM */
+      ns--;
+      *rx += 1;
+
+      while (ring->desc[mq->last_head].flags & MEMIF_DESC_FLAG_NEXT)
 	{
-	  b0->data = memif_get_buffer (conn, ring, mq->last_head);
-	  b0->data_len = ring->desc[mq->last_head].length;
-	  b0->buffer_len = ring->desc[mq->last_head].buffer_length;
+	  ring->desc[mq->last_head].flags &= ~MEMIF_DESC_FLAG_NEXT;
+	  mq->last_head = (mq->last_head + 1) & mask;
+	  b0->data_len += ring->desc[mq->last_head].length;
+	  b0->buffer_len += ring->desc[mq->last_head].buffer_length;
 #ifdef MEMIF_DBG_SHM
 	  print_bytes (b0->data +
 		       ring->desc[b0->desc_index].buffer_length * i++,
 		       ring->desc[b0->desc_index].buffer_length, DBG_TX_BUF);
-#endif
-	  mq->last_head = (mq->last_head + 1) & mask;
+#endif /* MEMIF_DBG_SHM */
 	  ns--;
 	  *rx += 1;
 	}
-      while (ring->desc[mq->last_head].flags & MEMIF_DESC_FLAG_NEXT);
+      mq->last_head = (mq->last_head + 1) & mask;
 
       count--;
       curr_buf++;
@@ -1895,8 +2007,8 @@
     err = MEMIF_ERR_NOBUF_DET;
 
   md->rx_queues_num =
-    (c->args.is_master) ? c->run_args.num_s2m_rings : c->
-    run_args.num_m2s_rings;
+    (c->args.is_master) ? c->run_args.num_s2m_rings : c->run_args.
+    num_m2s_rings;
 
   l1 = sizeof (memif_queue_details_t) * md->rx_queues_num;
   if (l0 + l1 <= buflen)
@@ -1915,8 +2027,8 @@
     }
 
   md->tx_queues_num =
-    (c->args.is_master) ? c->run_args.num_m2s_rings : c->
-    run_args.num_s2m_rings;
+    (c->args.is_master) ? c->run_args.num_m2s_rings : c->run_args.
+    num_s2m_rings;
 
   l1 = sizeof (memif_queue_details_t) * md->tx_queues_num;
   if (l0 + l1 <= buflen)
@@ -1949,8 +2061,8 @@
   if (c->fd < 0)
     return MEMIF_ERR_DISCONNECTED;
   uint8_t num =
-    (c->args.is_master) ? c->run_args.num_s2m_rings : c->
-    run_args.num_m2s_rings;
+    (c->args.is_master) ? c->run_args.num_s2m_rings : c->run_args.
+    num_m2s_rings;
   if (qid >= num)
     return MEMIF_ERR_QID;
 
