Fix for Python3

Small fix for Python3.
Using items instead of iteritems is slightly less effective in Python 2 but works for Python 3 and avoids an external dependency (on the six module).