Fixed cppcheck warnings introduced by previous commit