workaround for itervalues
fix iteritems for python3 compat