Fix bug writing prevalue
Add document type alias for new template