Fix deprecation errors on template variables