Use iteritems() in place of items() in a few more places.