Fixed some warnings from cppcheck