diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php
index 296afcd100e50d48dbfc095d390188bf43ff9185..51a3da38333ab2e5e100c9308c8f9468a1f976eb 100644
--- a/CRM/Report/Form.php
+++ b/CRM/Report/Form.php
@@ -161,6 +161,8 @@ class CRM_Report_Form extends CRM_Core_Form {
 
   public $_drilldownReport = array();
 
+  protected $_grandFlag = FALSE;
+
   /**
    * An attribute for checkbox/radio form field layout
    *
diff --git a/CRM/Report/Form/Contribute/Summary.php b/CRM/Report/Form/Contribute/Summary.php
index 9543fa7041a64b1e2e4d0c8c1a6d80b1776af442..9ac733ee67528f852ad2ceb1b3478c17e8ba7712 100644
--- a/CRM/Report/Form/Contribute/Summary.php
+++ b/CRM/Report/Form/Contribute/Summary.php
@@ -43,7 +43,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
     'pieChart' => 'Pie Chart',
   );
   protected $_customGroupExtends = array('Contribution');
-  protected $_customGroupGroupBy = TRUE; 
+  protected $_customGroupGroupBy = TRUE;
 
   public $_drilldownReport = array('contribute/detail' => 'Link to Detail Report');
 
@@ -109,11 +109,11 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
       ),
       'civicrm_financial_type' =>
       array('dao' => 'CRM_Financial_DAO_FinancialType',
-        'fields' => array('financial_type' => null,), 
+        'fields' => array('financial_type' => null,),
         'grouping' => 'contri-fields',
-        'group_bys' => array( 
-          'financial_type' => array('title' => ts('Financial Type')), 
-        ), 
+        'group_bys' => array(
+          'financial_type' => array('title' => ts('Financial Type')),
+        ),
       ),
       'civicrm_contribution' =>
       array(
@@ -121,8 +121,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
         //'bao'           => 'CRM_Contribute_BAO_Contribution',
         'fields' =>
         array(
-          'contribution_source' => array('title' => ts('Source'),
-		  ),
+          'contribution_source' => array('title' => ts('Source'), ),
           'currency' =>
           array('required' => TRUE,
             'no_display' => TRUE,
@@ -158,7 +157,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
             'type' => CRM_Utils_Type::T_STRING,
           ),
           'financial_type_id' =>
-          array('title' => ts('Financial Type'), 
+          array('title' => ts('Financial Type'),
             'operatorType' => CRM_Report_Form::OP_MULTISELECT,
             'options'  => CRM_Contribute_PseudoConstant::financialType(),
             'type' => CRM_Utils_Type::T_INT,
@@ -375,24 +374,24 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
   function from() {
     $this->_from = "
         FROM civicrm_contact  {$this->_aliases['civicrm_contact']}
-             INNER JOIN civicrm_contribution   {$this->_aliases['civicrm_contribution']} 
+             INNER JOIN civicrm_contribution   {$this->_aliases['civicrm_contribution']}
                      ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_contribution']}.contact_id AND
                         {$this->_aliases['civicrm_contribution']}.is_test = 0
-             LEFT  JOIN civicrm_financial_type  {$this->_aliases['civicrm_financial_type']} 
+             LEFT  JOIN civicrm_financial_type  {$this->_aliases['civicrm_financial_type']}
                      ON {$this->_aliases['civicrm_contribution']}.financial_type_id ={$this->_aliases['civicrm_financial_type']}.id
-             LEFT  JOIN civicrm_email {$this->_aliases['civicrm_email']} 
-                     ON ({$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_email']}.contact_id AND 
-                        {$this->_aliases['civicrm_email']}.is_primary = 1) 
-              
-             LEFT  JOIN civicrm_phone {$this->_aliases['civicrm_phone']} 
-                     ON ({$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_phone']}.contact_id AND 
+             LEFT  JOIN civicrm_email {$this->_aliases['civicrm_email']}
+                     ON ({$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_email']}.contact_id AND
+                        {$this->_aliases['civicrm_email']}.is_primary = 1)
+
+             LEFT  JOIN civicrm_phone {$this->_aliases['civicrm_phone']}
+                     ON ({$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_phone']}.contact_id AND
                         {$this->_aliases['civicrm_phone']}.is_primary = 1)";
 
     if ($this->_addressField) {
       $this->_from .= "
-                  LEFT JOIN civicrm_address {$this->_aliases['civicrm_address']} 
-                         ON {$this->_aliases['civicrm_contact']}.id = 
-                            {$this->_aliases['civicrm_address']}.contact_id AND 
+                  LEFT JOIN civicrm_address {$this->_aliases['civicrm_address']}
+                         ON {$this->_aliases['civicrm_contact']}.id =
+                            {$this->_aliases['civicrm_address']}.contact_id AND
                             {$this->_aliases['civicrm_address']}.is_primary = 1\n";
     }
   }
@@ -451,7 +450,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
       $select = "
             SELECT COUNT({$this->_aliases['civicrm_contribution']}.total_amount )       as count,
                    SUM({$this->_aliases['civicrm_contribution']}.total_amount )         as amount,
-                   ROUND(AVG({$this->_aliases['civicrm_contribution']}.total_amount), 2) as avg,                                                                                                                              {$this->_aliases['civicrm_contribution']}.currency as currency                
+                   ROUND(AVG({$this->_aliases['civicrm_contribution']}.total_amount), 2) as avg,                                                                                                                              {$this->_aliases['civicrm_contribution']}.currency as currency
             ";
       $group = "\nGROUP BY {$this->_aliases['civicrm_contribution']}.currency";
       $sql = "{$select} {$this->_from} {$this->_where}{$group}";
diff --git a/CRM/Utils/OpenFlashChart.php b/CRM/Utils/OpenFlashChart.php
index 344d6139978e87a55df181c84c8a91d61e9e5f1f..5147c54d50de24a98f38fea1a73af2e26fcbd4f9 100644
--- a/CRM/Utils/OpenFlashChart.php
+++ b/CRM/Utils/OpenFlashChart.php
@@ -473,7 +473,7 @@ class CRM_Utils_OpenFlashChart {
     return self::buildChart($chartData, $chart);
   }
 
-  function buildChart(&$params, $chart) {
+  static function buildChart(&$params, $chart) {
     $openFlashChart = array();
     if ($chart && is_array($params) && !empty($params)) {
       // build the chart objects.
diff --git a/api/v3/utils.php b/api/v3/utils.php
index bc50e3cc28cae0f3a6760ba808e2091ec96c442c..5fa2be30b95b9dd435f9aa70a27282ac90ac681b 100644
--- a/api/v3/utils.php
+++ b/api/v3/utils.php
@@ -1086,11 +1086,12 @@ function _civicrm_api3_validate_fields($entity, $action, &$params, $errorMode =
         //field is of type date or datetime
         _civicrm_api3_validate_date($params, $fieldname, $fieldInfo);
         break;
-    case 32://blob
+
+      case 32://blob
         _civicrm_api3_validate_html($params, $fieldname, $fieldInfo);
         break;
-      case CRM_Utils_Type::T_STRING:
 
+      case CRM_Utils_Type::T_STRING:
         _civicrm_api3_validate_string($params, $fieldname, $fieldInfo);
         break;