Fix code analysis warnings