Added py3 compatibility with iteritems