Fix template deprecations