Fixing sort comparator issue on Py 3.3
Fixing iteritems on dicts in Py 3.3