Scan build fixes

Fix some trivial warnings coming out of Clang's static analysis.