Fixed an error in tokenize_with_offsets().

It was giving out the wrong offsets sometimes.