Bunch of fixes for CMD CHECK warnings