small cppcheck/pvs-studio fixes