Make sure we don't encounter a runtime error by changing a dictionary we are iterating over