diff --git a/eloqua.inc b/eloqua.inc
index d34f2f1..090dafd 100644
--- a/eloqua.inc
+++ b/eloqua.inc
@@ -623,6 +623,7 @@ function _eloqua_unserialize_data_column($result_set) {
 function _eloqua_db_insert_update($index, $fields) {
   $insert_fields = $index + $fields;
   $do_update = FALSE;
+  $result = FALSE;
   try {
     $result = db_insert(ELOQUA_SCHEMA_WEBFORM)
       ->fields($insert_fields)
@@ -663,6 +664,7 @@ function _eloqua_db_insert_update($index, $fields) {
       $result = FALSE;
     }
   }
+  return $result;
 }
 
 // End of file
diff --git a/eloqua.module b/eloqua.module
index 81b3d37..798b700 100644
--- a/eloqua.module
+++ b/eloqua.module
@@ -166,16 +166,39 @@ function eloqua_form_webform_component_edit_form_validate($form, $form_state) {
 
 
 /**
+ * Apply defaults to the settings array.
+ * @param object $settings
+ * @return void
+ */
+function _eloqua_form_webform_node_form_alter_default_settings($settings) {
+  if (!isset($settings->{ELOQUA_WEBFORM_FIELD_ACTIVE})) {
+    $settings->{ELOQUA_WEBFORM_FIELD_ACTIVE} = 0;
+  }
+  if (!isset($settings->{ELOQUA_WEBFORM_FIELD_FORM_NAME})) {
+    $settings->{ELOQUA_WEBFORM_FIELD_FORM_NAME} = '';
+  }
+  if (!isset($settings->{ELOQUA_WEBFORM_FIELD_DATA})) {
+    $settings->{ELOQUA_WEBFORM_FIELD_DATA} = new stdClass();
+  }
+  if (!isset($settings->{ELOQUA_WEBFORM_FIELD_DATA}->process_every_page)) {
+    $settings->{ELOQUA_WEBFORM_FIELD_DATA}->process_every_page = 0;
+  }
+}
+
+
+/**
  * Implementation of hook_form_FORM_ID_alter().
  */
 function eloqua_form_webform_node_form_alter (&$form, $form_state) {
-  $form['buttons']['submit']['#submit'][] = 'eloqua_form_webform_node_form_submit';
+  $form['actions']['submit']['#submit'][] = 'eloqua_form_webform_node_form_submit';
   $form['#validate'][] = 'eloqua_form_webform_node_form_validate';
   // Load the form options from the database if available
   $settings = new stdClass();
   if (!empty($form['nid']['#value'])) {
     $settings = eloqua_webform_load($form['nid']['#value']);
   }
+
+  _eloqua_form_webform_node_form_alter_default_settings($settings);
   $form['eloqua'] = array(
     '#type' => 'fieldset',
     '#description' => t('Eloqua Integration Options'),
@@ -236,6 +259,7 @@ function eloqua_form_webform_node_form_submit ($form, &$form_state) {
   $webform->{ELOQUA_WEBFORM_FIELD_DATA} = (object) array(
     'process_every_page' => $values['elq_process_every_page'],
   );
+
   eloqua_webform_create($webform);
 }
 
