Most of the ringbuffer changes suggested by Holger