bug fix w.r.t. pairs output, nested list-list-of-tuples