Fix code analysis warnings and add checker to makefile.