Misc reference fixes. Added tokenize.