Fix deprecation warning in template