Fixed cppcheck internal warnings