fixes to CMat