Improved error handling (LNKNaiveBayesClassifier.m)