Fix static analysis warnings