Cppcheck fixes

A couple of issues reported by cppcheck.