diff --git a/matrix.module b/matrix.module
old mode 100644
new mode 100755
index c016851..074baf6
--- a/matrix.module
+++ b/matrix.module
@@ -452,7 +452,7 @@ function theme_matrix_table_form($form) {
           $row[] = $first_col[$row_key];
           foreach ($fields as $col_key => $field) {
             if (is_numeric($col_key)) {
-              $row[] = drupal_render($form[$col_key]);
+              $row[] = drupal_render($fields[$col_key]);
             }
           }
           $rows[] = $row;
@@ -462,7 +462,9 @@ function theme_matrix_table_form($form) {
   }
 
   $output = theme('table', $header, $rows, array('class' => 'matrix'));
-  $output .= drupal_render($form);
+  if ($field['widget']['type'] == 'table') {
+    $output .= drupal_render($form);
+  }
   return theme('form_element', $form, $output);
 }
 
@@ -657,9 +659,7 @@ function matrix_matrix_process($element, $edit, &$form_state, $form) {
 
   $processed_element = array(
     '#tree' => TRUE,
-/*
     '#theme' => 'matrix_table_form', 
-*/
     '#parents' => $element['#parents'],
     '#title' => $element['#title'],
     '#description' => $element['#description'],
