Minor improvements to XToCP / CPToX.