fix type checking/conversion of --ngram argument