Fix a likely broken for loop