Catch and fix exceptions on tokenization.
Merge remote-tracking branch 'upstream/master'

* upstream/master:
  Catch and fix exceptions on tokenization.
Update to latest.