Fix bug in setLanguageCategories method

@lineke - please ignore the second commit in this PR, I had a brain-dead moment and made a minor additional change to the file to discover why I wasn't seeing the first commit appear on GitHub.  *facepalm*