Fixes to build with CM.