Bugfix ringbuffer