Corrected bug for how to calculate SVM weights