fix for template_variant being NULL