Fix template regressions