Fixed bugs with weights
Merge branch 'fixweights' into dev -- fixed bugs in weights