More ring buffer fixes

Almost there...