Fix some static analysis warnings.
Fix some more static analysis warnings