Fixing pedantic warnings in CMS and fixing a MacOS compilation issue