minor fixes in ring_buf