Groovy 6573

Fixed the bug by doing all temp declarations before assign iteration variables for next iteration.