Fix incorrect conditions in pairsOf

Fixes ticket 435