Iteration over a list should be done using a copy.