issue#253: proposal

In order to address issue #253, please find a proposal of correction.
In case of sparse domains, should use i=i.nextValue(i) instead of i++ to enumerate