Fixing error messages and creation of vocabulary.

#5523