Some improvements in ring buffers