Delete codegen-produced files if codegen fails
More optimization of variant parse dispatch