When creating the inner iterator, make sure it points into the same vector as the outer iterator. Otherwise, attempts to reset the iterator wind up causing it to read out-of-bounds. Fixes #199.