Fix circular buffer problem.