Fix bug introduced in previous commit
Improve extraction of literal documents into the token stream