fixed errors from cppcheck