Merge pull request #447 from ariard/2020-01-fix-weight-computation