Convert loops to explicit lexical var+open.