fixing corner cases for word count.