Fix check function.

--HG--
extra : amend_source : 971a8444e67bd66a410775dfa4439d3c1cebafc4
Added tag 2.1 for changeset 1a5fcd76e639