Solved compiling error in CMMD function