Some small code cleanups via static analysis (cppcheck)