Merged small fixes to the ring buffer.