Bugfix for naive bayes