Renamings and minor fixes.
Inlining copyAndInsertPair().