Fix documentation errors on templates, close #331