diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index b20de08..8345dba 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -2263,13 +2263,13 @@ function theme_table($variables) {
  * Preprocess variables for theme_table().
  * @todo: update this once merged with head, and table.twig.html updated.
  */
-function template_preprocess_table($variables) {
+function template_preprocess_table(&$variables) {
   $header = $variables['header'];
   $rows = $variables['rows'];
-  $attributes = $variables['attributes'];
+  $table_attributes = $variables['attributes'];
   $colgroups = $variables['colgroups'];
   $sticky = $variables['sticky'];
-  $responsive = $variables['responsive'];
+  $is_responsive = $variables['responsive'];
   $empty = $variables['empty'];
 
   // Add sticky headers, if applicable.
@@ -2277,16 +2277,16 @@ function template_preprocess_table($variables) {
     drupal_add_library('system', 'drupal.tableheader');
     // Add 'sticky-enabled' class to the table to identify it for JS.
     // This is needed to target tables constructed by this function.
-    $attributes['class'][] = 'sticky-enabled';
+    $table_attributes['class'][] = 'sticky-enabled';
   }
   // If the table has headers and it should react responsively to columns hidden
   // with the classes represented by the constants RESPONSIVE_PRIORITY_MEDIUM
   // and RESPONSIVE_PRIORITY_LOW, add the tableresponsive behaviors.
-  if (count($header) && $responsive) {
+  if (count($header) && $is_responsive) {
     drupal_add_library('system', 'drupal.tableresponsive');
     // Add 'responsive-enabled' class to the table to identify it for JS.
     // This is needed to target tables constructed by this function.
-    $attributes['class'][] = 'responsive-enabled';
+    $table_attributes['class'][] = 'responsive-enabled';
   }
 
   // Format the table columns:
@@ -2427,7 +2427,9 @@ function template_preprocess_table($variables) {
       }
     }
   }
-
+  
+  // Set the table attributes
+  $variables['attributes'] = new Attribute($table_attributes);
   $variables['header'] = $header;
   $variables['rows'] = $rows;
 }
@@ -2915,7 +2917,7 @@ function _theme_table_cell($cell, $header = FALSE) {
  */
 function template_preprocess_table_cell(&$variables) {
   // Cells can be arrays or strings.
-  if (is_array($variables['cell']) && !empty($variables['cell']['data'])) {
+  if (is_array($variables['cell']) && isset($variables['cell']['data'])) {
     // The cell's data element can be a render array or a string.
     if (is_array($variables['cell']['data'])) {
       $variables['content'] = drupal_render($variables['cell']['data']);
