Bug fix for selecting most frequent word in generated HTML