Potential fix for dictionary being modified during enumeration.