cppcheck errors repaired