Fixed bug with template directives on custom elements.