Ported to latest CMS.