Fixed incorrect assignment of weight count.