fix some cppcheck warnings / cleanup