Fix a few minor bugs found by the Clang Analyzer.
Silence a few of Clang Analyzer's false positives.