Backport some CM changes.