Handling the bugs of NGramModelGeneration().