Fix issue with circular buffer.