Fix tokenizer error handling