fix wordCount handling of null input