diff --git a/core/includes/menu.inc b/core/includes/menu.inc
index 5aaec8c..11a17a3 100644
--- a/core/includes/menu.inc
+++ b/core/includes/menu.inc
@@ -37,7 +37,6 @@ function template_preprocess_menu_local_task(&$variables) {
   if (!empty($variables['element']['#active'])) {
     // Add text to indicate active tab for non-visual users.
     $active = '<span class="visually-hidden">' . t('(active tab)') . '</span>';
-    $variables['attributes']['class'] = array('active');
 
     // If the link does not contain HTML already, String::checkPlain() it now.
     // After we set 'html'=TRUE the link will not be sanitized by l().
@@ -54,6 +53,7 @@ function template_preprocess_menu_local_task(&$variables) {
     '#title' => $link_text,
     '#url' => $link['url'],
     '#options' => $link['localized_options'],
+    'active' => $active ? true : false,
   );
 }
 
diff --git a/core/modules/file/file.module b/core/modules/file/file.module
index 0bc0584..f3eaca3 100644
--- a/core/modules/file/file.module
+++ b/core/modules/file/file.module
@@ -1193,7 +1193,6 @@ function template_preprocess_file_managed_file(&$variables) {
   if (!empty($element['#attributes']['class'])) {
     $variables['attributes']['class'] = (array) $element['#attributes']['class'];
   }
-  $variables['attributes']['class'][] = 'form-managed-file';
 }
 
 /**
diff --git a/core/themes/classy/templates/file/file-managed-file.html.twig b/core/themes/classy/templates/file/file-managed-file.html.twig
index 9a33ae1..7a87511 100644
--- a/core/themes/classy/templates/file/file-managed-file.html.twig
+++ b/core/themes/classy/templates/file/file-managed-file.html.twig
@@ -12,6 +12,6 @@
  * @ingroup themeable
  */
 #}
-<div{{ attributes }}>
+<div{{ attributes.addClass('form-managed-file') }}>
   {{ element }}
 </div>
diff --git a/core/themes/classy/templates/system/menu-local-task.html.twig b/core/themes/classy/templates/system/menu-local-task.html.twig
index 5939203..dc69285 100644
--- a/core/themes/classy/templates/system/menu-local-task.html.twig
+++ b/core/themes/classy/templates/system/menu-local-task.html.twig
@@ -15,4 +15,4 @@
  * @ingroup themeable
  */
 #}
-<li{{ attributes }}>{{ link }}</li>
+<li{{ attributes.addClass(link.active ? 'active') }}>{{ link }}</li>
