Fix iteritems() call not compatible with python3.