Replace calls to dict.items with dict.iteritems