Python 3 does not like its dictionaries changing size during iteration.