[refs #79] Add code to deal with CMSs and loops