Fix multi-iterations crash bug.