Correct a ringbuffer bug, replace some todo by implementations (mostly listener/consumer code)