Fix iteration by reference