Remove use of iterkeys()
Remove some uses of itervalues