Fix some clang static analysis warnings