Fix cppcheck warnings