Added compatibility for python3 iterators on dict