Well that's a big bug...

Fix issue where wrong loop iterator was used.