Made changes for porting to CMS.