Fixes bug in weight calculations (introduced during previous testing)