Fix order of generation first and second in pair generator