fix paired iterator and add test