Fix #94 bug in for loops