diff --git a/src/Twig/WebformTwigExtension.php b/src/Twig/WebformTwigExtension.php
index 55defd771..3489e378a 100644
--- a/src/Twig/WebformTwigExtension.php
+++ b/src/Twig/WebformTwigExtension.php
@@ -11,11 +11,13 @@ use Drupal\webform\Utility\WebformLogicHelper;
 use Drupal\webform\Utility\WebformXss;
 use Drupal\webform\Utility\WebformYaml;
 use Drupal\webform\WebformSubmissionInterface;
+use Twig\Extension\AbstractExtension;
+use Twig\TwigFunction;
 
 /**
  * Twig extension with some useful functions and filters.
  */
-class WebformTwigExtension extends \Twig_Extension {
+class WebformTwigExtension extends AbstractExtension {
 
   /**
    * Twig options.
@@ -32,9 +34,9 @@ class WebformTwigExtension extends \Twig_Extension {
    */
   public function getFunctions() {
     return [
-      new \Twig_SimpleFunction('webform_html_editor_check_markup', [$this, 'webformHtmlEditorCheckMarkup']),
-      new \Twig_SimpleFunction('webform_debug', [$this, 'webformDebug']),
-      new \Twig_SimpleFunction('webform_token', [$this, 'webformToken']),
+      new TwigFunction('webform_html_editor_check_markup', [$this, 'webformHtmlEditorCheckMarkup']),
+      new TwigFunction('webform_debug', [$this, 'webformDebug']),
+      new TwigFunction('webform_token', [$this, 'webformToken']),
     ];
   }
 
diff --git a/templates/webform-element-help.html.twig b/templates/webform-element-help.html.twig
index a7bd4c012..d6e72199a 100644
--- a/templates/webform-element-help.html.twig
+++ b/templates/webform-element-help.html.twig
@@ -13,7 +13,7 @@
  * @ingroup themeable
  */
 #}
-{% spaceless %}
+{% apply spaceless %}
 {{ attach_library('webform/webform.element.help') }}
 <span{{ attributes }}><span aria-hidden="true">?</span></span>
-{% endspaceless %}
+{% endapply %}
