Yet another fix for circular buffer implementation.