Bugfixes for cppcheck implmentation