bug fixes on naive bayes