Make the template extraction method honor the encoding option.
Documentation fixes.