Fixing bug where errors from cm.exe was not handled