Fixes to make it compatible with CMSMS 2.x