diff --git a/src/FlexiformEntityFormDisplay.php b/src/FlexiformEntityFormDisplay.php
index 735615a..36bf13d 100644
--- a/src/FlexiformEntityFormDisplay.php
+++ b/src/FlexiformEntityFormDisplay.php
@@ -68,7 +68,9 @@ class FlexiformEntityFormDisplay extends EntityFormDisplay implements FlexiformE
 
       if ($widget = $this->getRenderer($name)) {
         if (strpos($name, ':')) {
-          list($namespace, $field_name) = explode(':', $name, 2);
+          $parts = explode(':', $name);
+          $field_name = array_pop($parts);
+          $namespace = implode(':', $parts);
 
           // This is a form entity element so we need to tweak parents so that
           // form state values are grouped by entity namespace.
@@ -244,6 +246,28 @@ class FlexiformEntityFormDisplay extends EntityFormDisplay implements FlexiformE
     }
   }
 
+
+  /**
+   * {@inheritform}
+   */
+  protected function getFieldDefinitions() {
+    $definitions = parent::getFieldDefinitions();
+
+    foreach ($this->formEntities as $namespace => $entity) {
+      $parts = explode(':', $entity['plugin']);
+      if ($parts[0] == 'referenced_entity') {
+        $entity_type = $parts[2];
+        $referenced_definitions = \Drupal::entityManager()->getFieldDefinitions('profile', $parts[4]);
+        foreach ($referenced_definitions as $field_name => $definition) {
+          $definitions[$namespace . ':' . $field_name] = $definition;
+        }
+      }
+    }
+    $this->fieldDefinitions = $definitions;
+
+    return $this->fieldDefinitions;
+  }
+
   /**
    * Get the form entity manager.
    */
diff --git a/src/Form/FormEntityAddForm.php b/src/Form/FormEntityAddForm.php
index da598b3..7c4ca58 100644
--- a/src/Form/FormEntityAddForm.php
+++ b/src/Form/FormEntityAddForm.php
@@ -35,8 +35,14 @@ class FormEntityAddForm extends FormEntityBaseForm {
     $form['#suffix'] = '</div>';
 
     if ($plugin_id = $form_state->get('selected_form_entity')) {
-      $plugin = $this->pluginManager->createInstance($plugin_id);
-      return $this->buildConfigurationForm($form, $form_state, $plugin, 'add');
+      $configuration = ['manager' => $form_entity_manager];
+      $plugin = $this->pluginManager->createInstance($plugin_id, $configuration);
+      $i = 0;
+      while ($this->namespaceExists($plugin_id . '_' . $i, $form, $form_state)) {
+        $i++;
+      }
+      $namespace = $plugin_id . '_' . $i;
+      return $this->buildConfigurationForm($form, $form_state, $plugin, $namespace);
     }
     else {
       // Prepare selector form.
