Merge "Fix static analyzer issues caught by clang"