Fixed bug for computing weight when not using single threshold