Several tokenizer bug fixes