Workaround for unclosed elements in templates