Fix a lot of errors that appeared with cppcheck
Improve the quality of the code further "by cppcheck"
Bugfix prev commit
Improve code with CppCheck and clang further