work around occasional segfault from accessing nonexistent last unigram