Deepcopy templates.