Replaced some occurrences of iteritems() by items().