Added missing code for multivariate factorization.