make the check work with iterator (so with OrderedDict).

Should solve travis-ci tests in this PR.