Make weighting sanity test pass on Ubuntu