Python 3 fix: replace iteritems() with items()