Null check for last_token.parent

Fixes #548
Minor clean up of tokenizer code