Fix for loop scopes