Finally found last bug in next, wasn't swapping tuples at the end. Everything's ready for the tests.