json: Change processWord.

Now the method processWord is producing better error messages.