Fixes iteration problem, not sure how, but this seems to work now.