Small improvements to templates