Fix issue with importNode for template element