Check to make sure there is a toc_token before trying to use it.

Fixes #1047