Fix several bugs in CC, DM