Fixed major sonar issues in CMService