fixed CLang compilation and corrected warnings