Fixed lots of bugs in factor_multivariate().