added cppcheck to build
fixed cppcheck errors