Fix some cppcheck warnings

Bug 77800 - cppcheck reports
4 files changed