Fix issues detected by clang static analysis. (scan-build -k make).