Fix cppcheck issues