some fixes to cycle buffer