Minor bug fixes on the SVM