fix some cppcheck found issues