Catch and fix exceptions on tokenization.