Fixed up template stuff