diff --git a/views/views-aggregator-results-table.tpl.php b/views/views-aggregator-results-table.tpl.php
index 9aeed76..07299eb 100644
--- a/views/views-aggregator-results-table.tpl.php
+++ b/views/views-aggregator-results-table.tpl.php
@@ -33,7 +33,7 @@
     <thead>
       <?php if (!empty($header)) : ?>
         <tr>
-          <?php foreach ($header as $field => $label): 
+          <?php foreach ($header as $field => $label):
             $hclasses = isset($header_classes[$field]) ? $header_classes[$field] : '';
             if ($field === $grouping_field) {
               $hclasses .= " $grouping_field_class";
@@ -65,7 +65,7 @@
     <tbody>
       <?php foreach ($rows as $r => $row): ?>
         <tr <?php if (!empty($row_classes[$r])): ?>class="<?php print implode(' ', $row_classes[$r]); ?>"<?php endif ?>>
-          <?php foreach ($row as $field => $content): 
+          <?php foreach ($row as $field => $content):
             $td_class = empty($field_classes[$field][$r]) ? '' : $field_classes[$field][$r];
             if ($field === $grouping_field) {
               $td_class .= " $grouping_field_class";
diff --git a/views/views_aggregator_plugin_style_table.inc b/views/views_aggregator_plugin_style_table.inc
index c2346b6..b9726a1 100644
--- a/views/views_aggregator_plugin_style_table.inc
+++ b/views/views_aggregator_plugin_style_table.inc
@@ -27,7 +27,7 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
     $options['group_aggregation'] = array(
       'contains' => array(
         'grouping_field_class' => array('default' => ''),
-      )
+      ),
     );
     $options['column_aggregation'] = array(
       'contains' => array(
@@ -35,7 +35,7 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
         'totals_row_position' => array('default' => array(1 => 0, 2 => 2)),
         'totals_row_class' => array('default' => ''),
         'precision' => array('default' => 2),
-      )
+      ),
     );
     return $options;
   }
@@ -51,7 +51,7 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
     foreach ($columns as $field => $column) {
       if ($field == $column) {
         // Make all columns potentially sortable, including Math Expressions.
-        // Do this before parent::options_form($form, $form_state);
+        // Do this before calling parent::options_form($form, $form_state).
         $handlers[$field]->definition['click sortable'] = TRUE;
       }
     }
@@ -160,8 +160,7 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
     $form['general']['use_field_handler'] = array(
       '#title' => '<strong>' . t('Use advanced numeric handler') . '</strong>',
       '#type' => 'checkbox',
-      '#description' => t('If checked, try to use the advanced options instead of simple numeric rendering.') . '<br/>' .
-        t('<em>Warning:</em> may not work with some numeric fields or settings, so verify that the results are as expected after enabling this option.'),
+      '#description' => t('If checked, try to use the advanced options instead of simple numeric rendering.') . '<br/>' . t('<em>Warning:</em> may not work with some numeric fields or settings, so verify that the results are as expected after enabling this option.'),
       '#default_value' => $this->options['general']['use_field_handler'],
     );
 
@@ -262,7 +261,7 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
     }
   }
 
-  /*
+  /**
    * Overrides pre_render().
    *
    * @param array $results
@@ -379,7 +378,8 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
   /**
    * Collect the aggregation functions from the Views UI.
    *
-   * @return array functions
+   * @return array
+   *   Function names.
    */
   protected function collect_aggregation_functions() {
     $functions = array();
@@ -471,7 +471,7 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
    *   Whether the rendered or raw value should be returned.
    *
    * @return string
-   *  Returns empty string if there are no results for the requested row_num.
+   *   Returns empty string if there are no results for the requested row_num.
    */
   public function get_cell($field_handler, $row_num, $render) {
     $field_name = $field_handler->options['id'];
@@ -510,7 +510,7 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
    *   the raw contents of the cell
    */
   private function get_cell_raw($field_handler, $result_row, $compressed = TRUE) {
-    
+
     $field_name = 'field_' . $field_handler->options['id'];
     if (isset($result_row->$field_name)) {
       $value = reset($result_row->$field_name);
@@ -547,7 +547,7 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
    *   A single or array of values to set. This should be the raw value(s),
    *   otherwise sorting may not work properly.
    * @param string $separator
-   *   The separator to use, when $new_values is an array
+   *   The separator to use, when $new_values is an array.
    *
    * @return mixed
    *   The rendered value.
@@ -606,13 +606,13 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
 
       // Need this test as views_handler_field_field::get_value() drastically
       // overrides views_handler_field::get_value() and will expect an entity
-      // to be present in $field_handler->view->result[$row_num]->_field_data 
+      // to be present in $field_handler->view->result[$row_num]->_field_data
       // and attempt to clone it, which results in WSOD when not there.
       // rendering this way is also no good for views_php_handler_fields and
       // views_handler_field_math fields.
       if ($this->is_numeric_field($field_handler)) {
         return $field_handler->render((object) array(
-          $field_handler->field_alias => $new_values
+          $field_handler->field_alias => $new_values,
         ));
       }
     }
@@ -658,7 +658,7 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
     return is_a($field_handler, 'views_handler_field_numeric') &&
       !is_a($field_handler, 'views_handler_field_math');
   }
-  
+
   protected function is_commerce_currency_amount($field_handler) {
     return !empty($field_handler->aliases['currency_code']);
   }
@@ -698,7 +698,7 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
    * Returns the rendered representation for a new webform value.
    *
    * @param object $field_handler
-   *   The webform handler associated with the field/table-column being requested.
+   *   The webform handler associated with the requested field/table-column.
    * @param int $row_num
    *   The result row number.
    * @param array $new_values
@@ -733,7 +733,8 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
    * @param object $field_handler
    * @param double $raw_value
    *
-   * @return string, number formatted according to Views handler settings
+   * @return string
+   *   Number formatted according to Views handler settings.
    *
    * Note: this was taken in part from views_handler_field_math::render($values)
    */
@@ -783,12 +784,12 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
    * The field will be rendered with appropriate CSS classes, without label.
    *
    * @param object $field_handler
-   *   The views_handler_field_field object belonging to the View result field
+   *   The views_handler_field_field object belonging to the View result field.
    * @param int $row_num
    *   The view result row number to change. Pass NULL to simply render
    *   $raw_value outside the context of a View, without affecting any rows.
    * @param mixed $raw_value
-   *   Compound or simple value. 
+   *   Compound or simple value.
    *   If NULL the row value of the field is re-rendered using its current
    *   (raw) value.
    *
@@ -809,15 +810,15 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
     $field_alias = $field_handler->field_alias;
     $row = isset($row_num) ? $field_handler->view->result[$row_num] : reset($field_handler->view->result);
     $affect_view = isset($row_num);
-    // _field_data[] contains the entities we'll be rendering from/to
+    // _field_data[] contains the entities we'll be rendering from/to.
     if (!$row || empty($row->_field_data[$field_alias])) {
       // This happens for ViewsPHP fields and for Math Expressions.
       return !$row || $affect_view ? FALSE : (isset($raw_value) ? $raw_value : '?');
     }
     // Note that when a 2nd copy of a field is used in the View, e.g.
-    // field_price_1, we refer back to the base field name, i.e. field_price
+    // field_price_1, we refer back to the base field name, i.e. field_price.
     $last_underscore = strrpos($real_field_name, '_');
-    if ((int)drupal_substr($real_field_name, $last_underscore + 1)) {
+    if ((int) drupal_substr($real_field_name, $last_underscore + 1)) {
       $field_name = drupal_substr($real_field_name, 0, $last_underscore);
     }
     $_field_data = $row->_field_data[$field_alias];
@@ -894,9 +895,9 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
    * Write the aggregated results back into the View's rendered results.
    *
    * @param array $groups
-   *   an array of groups, indexed by group name
+   *   An array of groups, indexed by group name.
    * @param array $values
-   *   an array of value arrays, indexed by field name first and group second
+   *   An array of value arrays, indexed by field name first and group second.
    */
   protected function set_aggregated_group_values($groups, $values) {
     $field_handlers = $this->view->field;
@@ -918,7 +919,7 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
    * Write the aggregated results back into the View results totals (footer).
    *
    * @param array $values
-   *   an array of field value arrays, indexed by field name and 'column'
+   *   An array of field value arrays, indexed by field name and 'column'.
    */
   protected function set_totals_row($values) {
     $totals = array();
@@ -945,7 +946,7 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
 
   /**
    * Returns if the supplied field is renderable through its native function.
-   * 
+   *
    * @param string $field_name
    * @param bool $is_column
    *
@@ -958,7 +959,7 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
     $aggr_functions = $this->options['info'][$field_name][$is_column ? 'aggr_column' : 'aggr'];
     $aggr_function = is_array($aggr_functions) ? end($aggr_functions) : $aggr_functions;
     $aggr_function_info = views_aggregator_get_aggregation_functions_info($aggr_function);
-    
+
     // Aggregation functions are considered renderable unless set to FALSE.
     return !isset($aggr_function_info['is_renderable']) || !empty($aggr_function_info['is_renderable']);
   }
@@ -1035,7 +1036,7 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
     // o dates and date ranges (@todo)
     //
     // Columns that need to be sorted using rendered, post-aggregated values:
-    // o Views PHP expressions, addresses, taxonomy terms
+    // o Views PHP expressions, addresses, taxonomy terms.
 
     $field_handler = $this->view->field[$this->active];
     $field_type = isset($field_handler->field_info['type']) ? $field_handler->field_info['type'] : '';
@@ -1052,14 +1053,14 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
     $cell1 = strip_tags($this->get_cell($field_handler, $row1->num, $compare_rendered));
     $cell2 = strip_tags($this->get_cell($field_handler, $row2->num, $compare_rendered));
 
-    if ((double)$cell1 == (double)$cell2) {
+    if ((double) $cell1 == (double) $cell2) {
       // If both cells cast to zero, then compare alphabetically.
       $compare = ($cell1 == $cell2) ? 0 : ($cell1 < $cell2 ? -1 : 1);
     }
     else {
       // Compare numerically, i.e. "20 km" comes after "9.5 km".
       // The double cast causes a read up to the first non-number related char.
-      $compare = (double)$cell1 < (double)$cell2 ? -1 : 1;
+      $compare = (double) $cell1 < (double) $cell2 ? -1 : 1;
     }
     return ($this->order == 'asc') ? $compare : -$compare;
   }
@@ -1071,14 +1072,14 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
    * passed in as an argument is in no way affected.
    *
    * @param object $view_with_pager
-   *   a View object
+   *   A View object.
    *
    * @param object $display_id
-   *   the display to execute, for example 'default', 'page', 'block'
+   *   The display to execute, for example 'default', 'page', 'block'.
    *
    * @return object
-   *   the pageless View, including the complete rendered results set on
-   *   $view->style_plugin->rendered_fields
+   *   The pageless View, including the complete rendered results set on
+   *   $view->style_plugin->rendered_fields.
    */
   protected function execute_view_without_pager($view_with_pager, $display_id = NULL) {
     // Apply the filters so the results reflect accurately.
@@ -1087,7 +1088,7 @@ class views_aggregator_plugin_style_table extends views_plugin_style_table {
     $clone = $view_with_pager->clone_view();
     $id = empty($clone->display[$display_id]->display_options['pager']) ? 'default' : $display_id;
     $clone->display[$id]->display_options['pager']['type'] = 'none';
-    
+
     $clone->is_temp_views_aggregator = TRUE;
     $clone->execute($display_id);
     return $clone;
diff --git a/views_aggregator.api.php b/views_aggregator.api.php
index 415b78f..c5dd9f0 100644
--- a/views_aggregator.api.php
+++ b/views_aggregator.api.php
@@ -20,12 +20,12 @@ function hook_views_aggregation_functions_info() {
   $functions = array(
     'views_aggregator_variance' => array(
       'group' => t('Variance'),
-      'column' => t('Variance'), // use NULL if not applicable
+      'column' => t('Variance'), // Use NULL if not applicable.
 
       // If your function operates on a numeric field, but the result is no
       // longer a (single) number, for example when enumerating values, then the
       // original renderer is not appropriate. In that case set this to FALSE.
-      'is_renderable' => TRUE, // this is the default
+      'is_renderable' => TRUE, // This is the default.
     ),
   );
   return $functions;
@@ -35,7 +35,7 @@ function hook_views_aggregation_functions_info() {
  * Alter existing aggregation functions.
  *
  * @param array $aggregation_functions
- *   the aggregation functions currently defined
+ *   The aggregation functions currently defined.
  */
 function hook_views_aggregation_functions_info_alter($aggregation_functions) {
 }
diff --git a/views_aggregator_functions.inc b/views_aggregator_functions.inc
index 146f46e..4bc3ccb 100644
--- a/views_aggregator_functions.inc
+++ b/views_aggregator_functions.inc
@@ -94,14 +94,14 @@ function views_aggregator_views_aggregation_functions_info() {
  * Matching takes place on the raw values (1000, rather than "$ 1,000").
  *
  * @param object $views_plugin_style
- *   an array of groups of rows, each group indexed by group value
+ *   An array of groups of rows, each group indexed by group value.
  * @param object $field_handler
- *   the handler for the view column to count groups members in
+ *   The handler for the view column to count groups members in.
  * @param string $regexp
- *   if empty all result rows are kept
+ *   If empty all result rows are kept.
  *
  * @return array
- *   a subset of the original array of groups
+ *   A subset of the original array of groups.
  */
 function views_aggregator_row_filter($views_plugin_style, $field_handler, $regexp = NULL) {
   if (empty($regexp)) {
@@ -128,14 +128,14 @@ function views_aggregator_row_filter($views_plugin_style, $field_handler, $regex
  * functions.
  *
  * @param object $view_results
- *   the result rows as they appear on the view object
+ *   The result rows as they appear on the view object.
  * @param object $field_handler
- *   the handler for the view column to group rows on
+ *   The handler for the view column to group rows on.
  * @param string $case
- *   whether group-inclusion is case-sensitive (the default)
+ *   Whether group-inclusion is case-sensitive (the default).
  *
  * @return array
- *   an array of groups, keyed by group value first and row number second.
+ *   An array of groups, keyed by group value first and row number second.
  */
 function views_aggregator_group_and_compress($view_results, $field_handler, $case = 'case-sensitive') {
   $groups = array();
@@ -169,7 +169,7 @@ function views_aggregator_group_and_compress($view_results, $field_handler, $cas
           $first_row = $row;
         }
         else {
-          foreach ((array)$row as $field_name => $cell) {
+          foreach ((array) $row as $field_name => $cell) {
             if ($field_name != '_field_data' && $cell == $first_row->{$field_name}) {
               unset($row->{$field_name});
             }
@@ -185,16 +185,16 @@ function views_aggregator_group_and_compress($view_results, $field_handler, $cas
  * Aggregates a field group as the average amongst its members.
  *
  * @param array $groups
- *   an array of groups of rows, each group indexed by group value
+ *   An array of groups of rows, each group indexed by group value.
  * @param object $field_handler
- *   the handler for the view column to find the average in
+ *   The handler for the view column to find the average in.
  * @param int $precision_group
- *   the number of decimals, if specified
+ *   The number of decimals, if specified.
  * @param int $precision_column
- *   the number of decimals, if specified
+ *   The number of decimals, if specified.
  *
  * @return array
- *   an array of values, one for each group and one for the column.
+ *   An array of values, one for each group and one for the column.
  */
 function views_aggregator_average($groups, $field_handler, $precision_group, $precision_column) {
   $values = array();
@@ -225,16 +225,16 @@ function views_aggregator_average($groups, $field_handler, $precision_group, $pr
  * Aggregates a field group as a count of the number of group members.
  *
  * @param array $groups
- *   an array of groups of rows, each group indexed by group value
+ *   An array of groups of rows, each group indexed by group value.
  * @param object $field_handler
- *   the handler for the view column to count groups members in
+ *   The handler for the view column to count groups members in.
  * @param string $group_regexp
- *   an optional regexp to count, if omitted all non-empty group values count
+ *   An optional regexp to count, if omitted all non-empty group values count.
  * @param string $column_regexp
- *   an optional regexp to count, if omitted all non-empty group values count
+ *   An optional regexp to count, if omitted all non-empty group values count.
  *
  * @return array
- *   an array of values, one for each group and one for the column
+ *   An array of values, one for each group and one for the column.
  */
 function views_aggregator_count($groups, $field_handler, $group_regexp = NULL, $column_regexp = NULL) {
   $values = array();
@@ -265,16 +265,16 @@ function views_aggregator_count($groups, $field_handler, $group_regexp = NULL, $
  * The enumeration is sorted "naturally" and duplicates are removed.
  *
  * @param array $groups
- *   an array of groups of rows, each group indexed by group value
+ *   An array of groups of rows, each group indexed by group value.
  * @param object $field_handler
- *   the handler for the view column to find members of the group
+ *   The handler for the view column to find members of the group.
  * @param string $separator_group
- *   the separator to use in group enumerations, defaults to '<br/>'
+ *   The separator to use in group enumerations, defaults to '<br/>'.
  * @param string $separator_column
- *   the separator to use for the column enumeration, defaults to '<br/>'
+ *   The separator to use for the column enumeration, defaults to '<br/>'.
  *
  * @return array
- *   an array of values, one for each group.
+ *   An array of values, one for each group.
  */
 function views_aggregator_enumerate($groups, $field_handler, $separator_group, $separator_column) {
   return _views_aggregator_enumerate($groups, $field_handler, $separator_group, $separator_column, TRUE, FALSE);
@@ -286,16 +286,16 @@ function views_aggregator_enumerate($groups, $field_handler, $separator_group, $
  * The enumeration retains the orignal order and does not remove duplicates.
  *
  * @param array $groups
- *   an array of groups of rows, each group indexed by group value
+ *   An array of groups of rows, each group indexed by group value.
  * @param object $field_handler
- *   the handler for the view column to find members of the group
+ *   The handler for the view column to find members of the group.
  * @param string $separator_group
- *   the separator to use in group enumerations, defaults to '<br/>'
+ *   The separator to use in group enumerations, defaults to '<br/>'.
  * @param string $separator_column
- *   the separator to use for the column enumeration, defaults to '<br/>'
+ *   The separator to use for the column enumeration, defaults to '<br/>'.
  *
  * @return array
- *   an array of values, one for each group.
+ *   An array of values, one for each group.
  */
 function views_aggregator_enumerate_raw($groups, $field_handler, $separator_group, $separator_column) {
   return _views_aggregator_enumerate($groups, $field_handler, $separator_group, $separator_column, FALSE, TRUE);
@@ -305,20 +305,20 @@ function views_aggregator_enumerate_raw($groups, $field_handler, $separator_grou
  * Aggregates a field group as the enumeration of its members.
  *
  * @param array $groups
- *   an array of groups of rows, each group indexed by group value
+ *   An array of groups of rows, each group indexed by group value.
  * @param object $field_handler
- *   the handler for the view column to find members of the group
+ *   The handler for the view column to find members of the group.
  * @param string $separator_group
- *   the separator to use in group enumerations, defaults to '<br/>'
+ *   The separator to use in group enumerations, defaults to '<br/>'.
  * @param string $separator_column
- *   the separator to use for the column enumeration, defaults to '<br/>'
+ *   The separator to use for the column enumeration, defaults to '<br/>'.
  * @param bool $sort
- *   whether or not to sort the enumeration
+ *   Whether or not to sort the enumeration.
  * @param bool $allow_duplicates
- *   whether or not to remoe duplicates from the enumeration
+ *   Whether or not to remoe duplicates from the enumeration.
  *
  * @return array
- *   an array of values, one for each group.
+ *   An array of values, one for each group.
  */
 function _views_aggregator_enumerate($groups, $field_handler, $separator_group, $separator_column, $sort = TRUE, $allow_duplicates = FALSE) {
   $separator_group = empty($separator_group) ? '<br/>' : $separator_group;
@@ -359,16 +359,16 @@ function _views_aggregator_enumerate($groups, $field_handler, $separator_group,
  * Aggregates a field in the column aggregation row as a math. expression.
  *
  * @param array $groups
- *   an array of groups of rows, each group indexed by group value
+ *   An array of groups of rows, each group indexed by group value.
  * @param object $field_handler
- *   the handler for the view column to evaluate the expression for
+ *   The handler for the view column to evaluate the expression for.
  * @param string $group_exp
- *   currently not supported
+ *   Currently not supported.
  * @param string $column_exp
- *   an optional regexp to count, if omitted all non-empty group values count
+ *   An optional regexp to count, if omitted all non-empty group values count.
  *
  * @return array
- *   an array of values, one for each group and one for the column
+ *   An array of values, one for each group and one for the column.
  */
 function views_aggregator_expression($groups, $field_handler, $group_exp = NULL, $column_exp = NULL) {
   $values = array();
@@ -398,12 +398,12 @@ function views_aggregator_expression($groups, $field_handler, $group_exp = NULL,
  * Aggregates a field group as the first member of the group.
  *
  * @param array $groups
- *   an array of groups of rows, each group indexed by group value
+ *   An array of groups of rows, each group indexed by group value.
  * @param object $field_handler
- *   the handler for the view column to find the first group member in
+ *   The handler for the view column to find the first group member in.
  *
  * @return array
- *   an empty array
+ *   An empty array.
  */
 function views_aggregator_first($groups, $field_handler) {
   // This is the default operation, so nothing to do, except for Webforms.
@@ -423,12 +423,12 @@ function views_aggregator_first($groups, $field_handler) {
  * Using numbers mixed with non-numeric strings is not recommended.
  *
  * @param array $groups
- *   an array of groups of rows, each group indexed by group value
+ *   An array of groups of rows, each group indexed by group value.
  * @param object $field_handler
- *   the handler for the view column to find the maximum groups member in
+ *   The handler for the view column to find the maximum groups member in.
  *
  * @return array
- *   an array of values, one for each group, plus the 'column' group
+ *   An array of values, one for each group, plus the 'column' group.
  */
 function views_aggregator_maximum($groups, $field_handler) {
   $values = array();
@@ -467,12 +467,12 @@ function views_aggregator_maximum($groups, $field_handler) {
  * job of dealing with the median of a group/column of strings.
  *
  * @param array $groups
- *   an array of groups of rows, each group indexed by group value
+ *   An array of groups of rows, each group indexed by group value.
  * @param object $field_handler
- *   the handler for the view column to calculate the median for
+ *   The handler for the view column to calculate the median for.
  *
  * @return array
- *   an array of values, one for each group, plus the 'column' group
+ *   An array of values, one for each group, plus the 'column' group.
  */
 function views_aggregator_median($groups, $field_handler) {
   $values = array();
@@ -488,13 +488,13 @@ function views_aggregator_median($groups, $field_handler) {
     }
     if (!empty($group_cells)) {
       sort($group_cells);
-      $m = (int)(count($group_cells) / 2);
+      $m = (int) (count($group_cells) / 2);
       $values[$group] = vap_num($group_cells[$m]) === FALSE || count($group_cells) % 2 ? $group_cells[$m] : ($group_cells[$m] + $group_cells[$m - 1]) / 2;
     }
   }
   if (!empty($column_cells)) {
     sort($column_cells);
-    $m = (int)(count($column_cells) / 2);
+    $m = (int) (count($column_cells) / 2);
     $values['column'] = vap_num($column_cells[$m]) === FALSE || count($column_cells) % 2 ? $column_cells[$m] : ($column_cells[$m] + $column_cells[$m - 1]) / 2;
   }
   return $values;
@@ -504,12 +504,12 @@ function views_aggregator_median($groups, $field_handler) {
  * Aggregates a field group as the minimum across its members.
  *
  * @param array $groups
- *   an array of groups of rows, each group indexed by group value
+ *   An array of groups of rows, each group indexed by group value.
  * @param object $field_handler
- *   the handler for the view column to find the minimum groups member in
+ *   The handler for the view column to find the minimum groups member in.
  *
  * @return array
- *   an array of values, one for each group, plus the 'column' group
+ *   An array of values, one for each group, plus the 'column' group.
  */
 function views_aggregator_minimum($groups, $field_handler) {
   $values = array();
@@ -518,7 +518,7 @@ function views_aggregator_minimum($groups, $field_handler) {
     $minimum = NULL;
     foreach ($rows as $num => $row) {
       $value = views_aggregator_get_cell($field_handler, $num, FALSE);
-      // Ignore empty strings
+      // Ignore empty strings.
       if (isset($value) && trim($value) != '') {
         if ($is_first) {
           $minimum = $value;
@@ -546,15 +546,15 @@ function views_aggregator_minimum($groups, $field_handler) {
  * Aggregates a field group as a range. Example: 5.5 - 14.9.
  *
  * @param array $groups
- *   an array of groups of rows, each group indexed by group value
+ *   An array of groups of rows, each group indexed by group value.
  * @param object $field_handler
- *   the handler for the view column
+ *   The handler for the view column.
  * @param string $separator_group
- *   the range separator between minimum and maximum values of the group range,
- *   not used here
+ *   The range separator between minimum and maximum values of the group range,
+ *   not used here.
  * @param string $separator_group
- *   the range separator between minimum and maximum values of the column range,
- *   not used here
+ *   The range separator between minimum and maximum values of the column range,
+ *   not used here.
  *
  * @return array
  *   An array of ranges, one for each group and one for the 'column'.
@@ -594,16 +594,16 @@ function views_aggregator_range($groups, $field_handler, $separator_group = NULL
  * Aggregates a field group as a word, phrase or number.
  *
  * @param array $groups
- *   an array of groups of rows, each group indexed by group value
+ *   An array of groups of rows, each group indexed by group value.
  * @param object $field_handler
- *   the handler for the view column
+ *   The handler for the view column.
  * @param string $replace_text
- *   an optional parameter, specifying the replacement text to use
+ *   An optional parameter, specifying the replacement text to use.
  * @param string $column_label
- *   an optional parameter, specifying a label placed the bottom of the column
+ *   An optional parameter, specifying a label placed the bottom of the column.
  *
  * @return array
- *   an array of values, one for each group and one for the 'column'
+ *   An array of values, one for each group and one for the 'column'.
  */
 function views_aggregator_replace($groups, $field_handler, $replace_text = NULL, $column_label = NULL) {
   $values = array();
@@ -628,12 +628,12 @@ function views_aggregator_replace($groups, $field_handler, $replace_text = NULL,
  * Aggregates a field group as the sum of its members.
  *
  * @param array $groups
- *   an array of groups of rows, each group indexed by group value
+ *   An array of groups of rows, each group indexed by group value.
  * @param object $field_handler
- *   the handler for the view column to sum groups in
+ *   The handler for the view column to sum groups in.
  *
  * @return array
- *   an array of values, one for each group, plus the 'column' group
+ *   An array of values, one for each group, plus the 'column' group.
  */
 function views_aggregator_sum($groups, $field_handler) {
   $values = array();
@@ -657,16 +657,17 @@ function views_aggregator_sum($groups, $field_handler) {
  * Aggregates a field group as the tally of its members.
  *
  * @param array $groups
- *   an array of groups of rows, each group indexed by group value
+ *   An array of groups of rows, each group indexed by group value.
  * @param object $field_handler
- *   the handler for the view column to find members of the group
+ *   The handler for the view column to find members of the group.
  * @param string $separator_group
- *   the separator to use between tallies in a group, defaults to '<br/>'
+ *   The separator to use between tallies in a group, defaults to '<br/>'.
  * @param string $separator_column
- *   the separator to use between tallies in the totals field, defaults to '<br/>'
+ *   The separator to use between tallies in the totals field, defaults to
+ *   '<br/>'.
  *
  * @return array
- *   an array of values, one for each group
+ *   An array of values, one for each group.
  */
 function views_aggregator_tally($groups, $field_handler, $separator_group, $separator_column) {
   $separator_group = empty($separator_group) ? '<br/>' : $separator_group;
@@ -724,5 +725,5 @@ function views_aggregator_tally($groups, $field_handler, $separator_group, $sepa
 function vap_num($string) {
   // Strip out any spaces and thousand makers.
   $stripped = str_replace(array(' ', ','), '', $string);
-  return preg_match('/[-+]?\d*\.?\d+/', $stripped, $matches) ? (double)$matches[0] : FALSE;
+  return preg_match('/[-+]?\d*\.?\d+/', $stripped, $matches) ? (double) $matches[0] : FALSE;
 }
diff --git a/views_aggregator_more_functions/views_aggregator_more_functions.module b/views_aggregator_more_functions/views_aggregator_more_functions.module
index 98040be..05361c0 100644
--- a/views_aggregator_more_functions/views_aggregator_more_functions.module
+++ b/views_aggregator_more_functions/views_aggregator_more_functions.module
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * @file views_aggregator_more_functions.module
+ * @file
  * Defines additional aggregation functions for Views Aggregator Plus.
  */
 
@@ -19,7 +19,7 @@ function views_aggregator_more_functions_views_aggregation_functions_info() {
     'views_aggregator_percentage' => array(
       'group' => t('Percentage'),
       'column' => t('100%'),
-      'is_renderable' => TRUE
+      'is_renderable' => TRUE,
     ),
   );
   return $functions;
@@ -29,15 +29,18 @@ function views_aggregator_more_functions_views_aggregation_functions_info() {
  * Replace the cell by the group sequence number (resulting table row number).
  *
  * @param array $groups
- * @param object $field_handler, not used
- * @param int $start_value, # at which to start the sequence, defaults to 1
+ * @param object $field_handler
+ *   Not used.
+ * @param int $start_value
+ *   Number at which to start the sequence, defaults to 1.
+ *
  * @return values
  */
 function views_aggregator_group_seq_number($groups, $field_handler = NULL, $start_value = NULL) {
   $values = array();
   $count = (!isset($start_value) || $start_value == '') ? 1 : (int) $start_value;
   foreach ($groups as $group => $rows) {
-      $values['column'] = $values[$group] = $count++;
+    $values['column'] = $values[$group] = $count++;
   }
   return $values;
 }
@@ -46,12 +49,13 @@ function views_aggregator_group_seq_number($groups, $field_handler = NULL, $star
  * Aggregates a field group total as the percentage of the column total.
  *
  * @param array $groups
- *   an array of groups of rows, each group indexed by group value
+ *   An array of groups of rows, each group indexed by group value.
  * @param object $field_handler
- *   the handler for the view column to calculate percentages in
+ *   The handler for the view column to calculate percentages in.
  *
  * @return array
- *   an array of values, one for each group and one for the column (always 100%)
+ *   An array of values, one for each group and one for the column
+ *   (always 100%).
  */
 function views_aggregator_percentage($groups, $field_handler, $arg_group, $arg_column) {
   $values = array();
@@ -73,4 +77,4 @@ function views_aggregator_percentage($groups, $field_handler, $arg_group, $arg_c
   }
   $values['column'] = 100;
   return $values;
-}
\ No newline at end of file
+}
