Finish circular buffer and its tests