fix merge errors + restore some previous cleanup prior to merge update