diff --git a/plugins/relation.inc b/plugins/relation.inc
index 27c7772..00e406b 100644
--- a/plugins/relation.inc
+++ b/plugins/relation.inc
@@ -1,7 +1,6 @@
 <?php
 /**
  * @file
- *
  * Is an alter plugin for defaultcontent
  *
  * Handles the exporting and importing of relation fields
@@ -14,51 +13,55 @@ $plugin = array();
  *
  * Change the node_ref field to refer to the machine_name of the
  * references nodes
-    'field_album' => array(
-      'und' => array(
-        0 => array(
-          'relation_id' => '92',
-          'endpoints' => array(
-            1 => 'node:11',
-          ),
-        ),
-        'entity_id' => 108,
-      ),
-    ),
-*/
-
-/**
- * Implements hook_export_alter().
+ *  'field_album' => array(
+ *    'und' => array(
+ *      0 => array(
+ *        'relation_id' => '92',
+ *        'endpoints' => array(
+ *          1 => 'node:11',
+ *        ),
+ *      ),
+ *      'entity_id' => 108,
+ *    ),
+ *  ),
  */
 function relation_export_alter(&$node) {
 
-  //Get all fields that are relations.
-  $fields = get_relation_fields();
-
-  //Loop through all fields.
-  foreach ($fields as $field_name => $field) {
-    //Check for whether the field is set.
-    if (isset($node->{$field_name})) {
-
-      foreach ($node->{$field_name} as $lang => $items) {
-        foreach ($items as $key => $item) {
-          $relations = array();
-
-          //Check to make sure this node has endpoints that will be reset.
-          if (isset($item['endpoints']))  {
-            foreach ($item['endpoints'] as $epkey => $epvalue) {
-
-              //Pull the type of the node and the node id.
-              list($entity, $nid) = explode(":", $epvalue);
-
-              //Grab the machine name of the node that the relation points to, based on the nid.
-              if ($machine_name = defaultcontent_get_default($nid))   {
-                //Reset the nid with a reference to the machine name of the node.
-                $node->{$field_name}[$lang][$key]['endpoints'][$epkey] = array("machine_name" => $machine_name);
-              }
-              else {
-                //Do we need this check? Most likely not.
-                unset($node->{$field_name}[$lang][$key]);
+  // @todo The export alter is called twice for every node
+  // when enabling a feature with the demo content. After a node is processed
+  // it will add an array to the field's endpoints, which will then casue
+  // an error when exploding the (node:12) string whcih we need to do to get
+  // the machine name into the export.
+  if (!(is_array($node->field_album['und'][0]['endpoints'][1]))) {
+
+    // Get all fields that are relations.
+    $fields = get_relation_fields();
+
+    // Loop through all fields.
+    foreach ($fields as $field_name => $field) {
+      // Check for whether the field is set.
+      if (isset($node->{$field_name})) {
+
+        foreach ($node->{$field_name} as $lang => $items) {
+          foreach ($items as $key => $item) {
+            $relations = array();
+
+            // Check to make sure this node has endpoints that will be reset.
+            if (isset($item['endpoints'])) {
+              foreach ($item['endpoints'] as $epkey => $epvalue) {
+                // Pull the type of the node and the node id.
+                list($entity, $nid) = explode(":", $epvalue);
+                // Grab the machine name of the node that the relation points
+                // to, based on the nid.
+                if ($machine_name = defaultcontent_get_default($nid)) {
+                  // Reset the nid with a reference to the machine name
+                  // of the node.
+                  $node->{$field_name}[$lang][$key]['endpoints'][$epkey] = array("machine_name" => $machine_name);
+                }
+                else {
+                  // Do we need this check? Most likely not.
+                  unset($node->{$field_name}[$lang][$key]);
+                }
               }
             }
           }
@@ -66,19 +69,19 @@ function relation_export_alter(&$node) {
       }
     }
   }
-} 
+}
 
 /**
  * Implements hook_import_alter().
  *
- * Handles the importing of relationship_select fields. Relationship select
- * fields are just dummy fields, but we can use them to look for the relationship.
+ * Relationship select fields are just dummy fields, but we can use them to
+ * look for the relationship.
  */
 function relation_import_alter(&$node) {
 
-    // @todo we could make this handle more than one set of endpoints.
-    // Right now we only have one set of endpoints so using array key 1.
-   if(isset($node->field_album['und'][0]['endpoints'][1]['machine_name'])) {
+  // @todo we could make this handle more than one set of endpoints.
+  // Right now we only have one set of endpoints so using array key 1.
+  if (isset($node->field_album['und'][0]['endpoints'][1]['machine_name'])) {
 
     $album_machine = $node->field_album['und'][0]['endpoints'][1]['machine_name'];
     $album_nid = defaultcontent_get_default($album_machine);
