Better handling of special tokens in ToC hooks