A red flag popped up in my head regarding the ring buffer so I fixed it. Should make things super safe regarding output buffer underflows.