Fix bug due to wrong loop variable order

This is an incarnation of the same bug fixed in commit 1cc0818d22c48d74.
Since the paper only gives the eager version of the iterative refinement
checking algorithm, I forgot to fix the lazy implementation.

Thanks for Peter Schrammel who reported the bug!