Make a couple improvements/fixes to templates