Changes as suggested in code review for document templates feature.