Fix syntax error for array iteration