Fix pair construction problems with some compilers