Fixed Cppcheck warnings