Improve code with CppCheck and clang further