Fixes from clang warning cleanup and clang static analysis.