Fixed some cppcheck warnings.