Fix issue in firefox with tmpl being undefined