1) Fixed some bugs in cycle.