Fixed bug in weight addition.