Imputation bug fixes, incl em_weight overhaul