diff --git a/components/date.inc b/components/date.inc
index f359b30..3b41cf5 100644
--- a/components/date.inc
+++ b/components/date.inc
@@ -117,10 +117,10 @@ function _webform_edit_date($component) {
  */
 function _webform_render_date($component, $value = NULL, $filter = TRUE) {
   $element = array(
+    '#type' => 'date',
     '#title' => $filter ? _webform_filter_xss($component['name']) : $component['name'],
     '#title_display' => $component['extra']['title_display'] ? $component['extra']['title_display'] : 'before',
     '#weight' => $component['weight'],
-    '#type' => 'date',
     '#description' => $filter ? _webform_filter_descriptions($component['extra']['description']) : $component['extra']['description'],
     '#required' => $component['mandatory'],
     '#year_start' => $component['extra']['year_start'],
diff --git a/components/fieldset.inc b/components/fieldset.inc
index 25b051e..db47d4f 100644
--- a/components/fieldset.inc
+++ b/components/fieldset.inc
@@ -52,13 +52,13 @@ function _webform_edit_fieldset($component) {
  */
 function _webform_render_fieldset($component, $value = NULL, $filter = TRUE) {
   $element = array(
-    '#type' => $component['type'],
+    '#type' => 'fieldset',
     '#title' => $filter ? _webform_filter_xss($component['name']) : $component['name'],
     '#weight' => $component['weight'],
     '#description' => $filter ? _webform_filter_descriptions($component['extra']['description']) : $component['extra']['description'],
     '#collapsible' => $component['extra']['collapsible'],
     '#collapsed' => $component['extra']['collapsed'],
-    '#attributes' => array('class' => array('webform-component-' . $component['type']), 'id' => 'webform-component-' . $component['form_key']),
+    '#attributes' => array('class' => array('webform-component-fielset'), 'id' => 'webform-component-' . $component['form_key']),
     '#pre_render' => array('webform_fieldset_prerender'),
     '#webform_component' => $component,
   );
diff --git a/components/file.inc b/components/file.inc
index d8daa81..d9db5bb 100644
--- a/components/file.inc
+++ b/components/file.inc
@@ -291,10 +291,18 @@ function theme_webform_edit_file($variables) {
  * Implementation of _webform_render_component().
  */
 function _webform_render_file($component, $value = NULL, $filter = TRUE) {
-  $node = node_load($component['nid']);
-  $form_key = implode('_', webform_component_parent_keys($node, $component));
+  // Normally every file component is given a unique ID based on its key.
+  if (isset($component['nid'])) {
+    $node = node_load($component['nid']);
+    $form_key = implode('_', webform_component_parent_keys($node, $component));
+  }
+  // If being used as a default though, we don't yet have a form key.
+  else {
+    $form_key = 'default';
+  }
+
   $element[$form_key] = array(
-    '#type' => $component['type'],
+    '#type' => 'file',
     //'#required' => $component['mandatory'], // Drupal core bug with required file uploads.
     '#attributes' => $component['extra']['attributes'],
     '#tree' => FALSE, // file_check_upload assumes a flat $_FILES structure.
diff --git a/components/textfield.inc b/components/textfield.inc
index 8f24688..6017738 100644
--- a/components/textfield.inc
+++ b/components/textfield.inc
@@ -121,7 +121,7 @@ function _webform_edit_textfield($component) {
  */
 function _webform_render_textfield($component, $value = NULL, $filter = TRUE) {
   $element = array(
-    '#type' => $component['type'],
+    '#type' => 'textfield',
     '#title' => $filter ? _webform_filter_xss($component['name']) : $component['name'],
     '#title_display' => $component['extra']['title_display'] ? $component['extra']['title_display'] : 'before',
     '#default_value' => $filter ? _webform_filter_values($component['value'], NULL, NULL, NULL, FALSE) : $component['value'],
