Fix problem with different number of iterations in v1 and improve test
cases