Cppcheck warnings fixed