Fixes "template is not defined"