Fixed some ambiguities with for loops caused by changes in this branch