Fix some code analysis warnings