Fix for-loop syntax error