Fix serious bug in weight matrix construction