Add cppcheck and cleanup things found in it