diff --git a/CRM/Financial/BAO/FinancialAccount.php b/CRM/Financial/BAO/FinancialAccount.php
index 4f1a87b734adc4c5488a0609f8df1b942efc83ed..dcf52d2c2eb2a0bbd70475c09fe885d633b103c7 100644
--- a/CRM/Financial/BAO/FinancialAccount.php
+++ b/CRM/Financial/BAO/FinancialAccount.php
@@ -110,7 +110,9 @@ class CRM_Financial_BAO_FinancialAccount extends CRM_Financial_DAO_FinancialAcco
     // action is taken depending upon the mode
     $financialAccount = new CRM_Financial_DAO_FinancialAccount();
     $financialAccount->copyValues($params);
-    $financialAccount->id = CRM_Utils_Array::value('contributionType', $ids);
+    if (!empty($ids['contributionType'])) {
+      $financialAccount->id = CRM_Utils_Array::value('contributionType', $ids);
+    }
     $financialAccount->save();
     return $financialAccount;
   }
diff --git a/CRM/Financial/BAO/FinancialType.php b/CRM/Financial/BAO/FinancialType.php
index 8abb756abbda9207f50c8a433266a1c6bfa60d9b..72c4cf421ba3956e30c80bc650c4a14568141400 100644
--- a/CRM/Financial/BAO/FinancialType.php
+++ b/CRM/Financial/BAO/FinancialType.php
@@ -95,7 +95,7 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType {
    * @static
    * @return object
    */
-  static function add(&$params, &$ids) {
+  static function add(&$params, &$ids = array()) {
     $params['is_active'] = CRM_Utils_Array::value('is_active', $params, false);
     $params['is_deductible'] = CRM_Utils_Array::value('is_deductible', $params, false);
     $params['is_reserved'] = CRM_Utils_Array::value('is_reserved', $params, false);
diff --git a/CRM/Mailing/BAO/Component.php b/CRM/Mailing/BAO/Component.php
index 51975bf52ccf15133dea9810b4a10b114f6cc7b8..3e094e55de164d9c42e14a4644808252b7ad79b6 100644
--- a/CRM/Mailing/BAO/Component.php
+++ b/CRM/Mailing/BAO/Component.php
@@ -93,15 +93,15 @@ class CRM_Mailing_BAO_Component extends CRM_Mailing_DAO_Component {
     // action is taken depending upon the mode
     $component = new CRM_Mailing_DAO_Component();
     $component->name = $params['name'];
-    $component->component_type = $params['component_type'];
-    $component->subject = $params['subject'];
-    if ($params['body_text']) {
-      $component->body_text = $params['body_text'];
+    $component->component_type = CRM_Utils_Array::value('component_type', $params);
+    $component->subject = CRM_Utils_Array::value('subject', $params);
+    if (CRM_Utils_Array::value('body_text', $params)) {
+      $component->body_text = CRM_Utils_Array::value('body_text', $params);
     }
     else {
-      $component->body_text = CRM_Utils_String::htmlToText($params['body_html']);
+      $component->body_text = CRM_Utils_String::htmlToText(CRM_Utils_Array::value('body_html', $params));
     }
-    $component->body_html = $params['body_html'];
+    $component->body_html = CRM_Utils_Array::value('body_html', $params);
     $component->is_active = CRM_Utils_Array::value('is_active', $params, FALSE);
     $component->is_default = CRM_Utils_Array::value('is_default', $params, FALSE);
 
diff --git a/api/v3/examples/UFJoin/Create.php b/api/v3/examples/UFJoin/Create.php
index 11d976380ce423c854db7fc7ba05ba3a58518dc5..5eaba20a6e99259aec363080267675f0b1fddd40 100644
--- a/api/v3/examples/UFJoin/Create.php
+++ b/api/v3/examples/UFJoin/Create.php
@@ -47,6 +47,7 @@ function uf_join_create_expectedresult(){
           'entity_id' => '1',
           'weight' => '1',
           'uf_group_id' => '11',
+          'module_data' => '',
         ),
     ),
 );