[wmlunits] Backport changes in master to 1.10.