diff --git a/js/moderator.js b/js/moderator.js
index f909ad3..5a1ecb3 100644
--- a/js/moderator.js
+++ b/js/moderator.js
@@ -168,10 +168,10 @@ function maestro_get_project_details(obj) {
         jQuery('#maestro_viewdetail_' + projectID).attr('src',newicon);
 
         } else {
-          alert('An error occurred updating assignment');
+          alert(Drupal.t('An error occurred updating assignment'));
         }
       },
-      error: function() { alert('there was a SERVER Error processing AJAX request'); }
+      error: function() { alert(Drupal.t('there was a SERVER Error processing AJAX request')); }
 
       });
     }
@@ -183,4 +183,4 @@ function maestro_get_project_details(obj) {
     jQuery('#maestro_viewdetail_' + projectID).attr('src',newicon);
     }
 
-}
\ No newline at end of file
+}
diff --git a/js/taskconsole.js b/js/taskconsole.js
index 8ce53d1..9ba7e70 100644
--- a/js/taskconsole.js
+++ b/js/taskconsole.js
@@ -49,10 +49,10 @@ jQuery(function($) {
             $('#maestro_taskconsole_detail_rec' + taskid).show();
             $('#maestro_ajax_indicator' + taskid).hide();
           } else {
-            alert('An error occurred updating assignment');
+            alert(Drupal.t('An error occurred updating assignment'));
           }
         },
-        error: function() { alert('there was a SERVER Error processing AJAX request'); }
+        error: function() { alert(Drupal.t('there was a SERVER Error processing AJAX request')); }
 
       });
 
@@ -80,12 +80,12 @@ function maestro_ajaxUpdateTaskAssignment(id) {
       dataType: 'json',
       success:  function (data) {
         if (data.status != 1) {
-          alert('An error occurred updating assignment');
+          alert(Drupal.t('An error occurred updating assignment'));
         } else {
           $("#assigned_user_row" + id).html(data.username);
         }
       },
-      error: function() { alert('there was a SERVER Error processing AJAX request'); }
+      error: function() { alert(Drupal.t('there was a SERVER Error processing AJAX request')); }
 
     });
   })(jQuery);
@@ -109,7 +109,7 @@ function maestro_ajaxDeleteProject(id, message) {
 	    	}
 	    },
 	    error: function() { 
-	    	alert('there was a SERVER Error processing AJAX request'); 
+	    	alert(Drupal.t('there was a SERVER Error processing AJAX request')); 
 	    }
       });
    	})(jQuery);
@@ -137,11 +137,11 @@ function ajaxMaestroComment(op, rowid, id, cid) {
             $('#projectCommentsOpen_rec' + rowid).html(data.html);
             $('html,body').animate({scrollTop: $('#projectCommentsOpen_rec' + rowid).offset().top-1},500);
           } else {
-            alert('An error occurred adding comment');
+            alert(Drupal.t('An error occurred adding comment'));
           }
         },
         error : function() {
-          alert('there was a SERVER Error processing AJAX request');
+          alert(Drupal.t('there was a SERVER Error processing AJAX request'));
         }
 
       });
@@ -165,11 +165,11 @@ function ajaxMaestroComment(op, rowid, id, cid) {
           $('#projectCommentsOpen_rec' + rowid).html(data.html);
           $('html,body').animate({scrollTop: $('#projectCommentsOpen_rec' + rowid).offset().top-1},500);
         } else {
-          alert('An error occurred deleting comment');
+          alert(Drupal.t('An error occurred deleting comment'));
         }
       },
       error : function() {
-        alert('there was a SERVER Error processing AJAX request');
+        alert(Drupal.t('there was a SERVER Error processing AJAX request'));
       }
 
     });
@@ -210,10 +210,10 @@ jQuery(function($) {
             $("#maestro_taskconsole_detail_rec" + taskid).hide();
           }
         } else {
-          alert('An error occurred processing this interactive task');
+          alert(Drupal.t('An error occurred processing this interactive task'));
         }
       },
-      error : function() { alert('there was a SERVER Error processing AJAX request'); },
+      error : function() { alert(Drupal.t('there was a SERVER Error processing AJAX request')); },
       data : dataString
     });
     return false;
diff --git a/maestro.admin.inc b/maestro.admin.inc
index e1b71a7..e7ee87e 100644
--- a/maestro.admin.inc
+++ b/maestro.admin.inc
@@ -8,7 +8,7 @@
 include_once './' . drupal_get_path('module', 'maestro') . '/maestro_interface.class.php';
 include_once './' . drupal_get_path('module', 'maestro') . '/maestro_task_interface.class.php';
 
-function maestro_admin($tid=0, $operation='', $var=0) {
+function maestro_admin($tid = 0, $operation = '', $var = 0) {
   global $base_url;
   $maestro_path = $base_url . '/' . drupal_get_path('module', 'maestro');
   drupal_add_css(drupal_get_path('module', 'maestro') . '/css/maestro.css');
@@ -18,7 +18,7 @@ function maestro_admin($tid=0, $operation='', $var=0) {
 }
 
 //called from the hooks_menu
-function maestro_edit_workflow($tid='') {
+function maestro_edit_workflow($tid = '') {
   global $base_url;
 
   if ($tid === '') drupal_goto('admin/structure/maestro');
@@ -47,19 +47,19 @@ function maestro_handle_editor_ajax_request($task_type, $template_data_id, $temp
   exit();
 }
 
-function maestro_handle_structure_ajax_request(){
+function maestro_handle_structure_ajax_request() {
   global $base_url;
-  if(!user_access('maestro admin')) return false;
+  if (!user_access('maestro admin')) return FALSE;
   $op=@check_plain($_POST['op']);
   $cntr=@check_plain($_POST['cntr']);
   $id=@check_plain($_POST['id']);
 
-  switch($op){
+  switch ($op) {
     case 'openimport':
       //the fact that they made it in here means that we're OK as far as security is concerned.
       //we have to check to see if the config parameter is set to even show this option.
       $status = 0;
-      if(variable_get('maestro_enable_import_window',0) == 1) {
+      if (variable_get('maestro_enable_import_window', 0) == 1) {
         $status = 1;
       }
       $arr=array('status' => $status);
@@ -69,12 +69,12 @@ function maestro_handle_structure_ajax_request(){
 
     case 'doimport':
       $status = 0;
-      if(variable_get('maestro_enable_import_window',0) == 1) {
+      if (variable_get('maestro_enable_import_window', 0) == 1) {
         $templatecode=($_POST['templatecode']);
         //Lets see if someone has tried to do something "evil".
-        if(strpos(strtolower($templatecode),'delete') !== FALSE ||
-        strpos(strtolower($templatecode),'drop') !== FALSE ||
-        strpos(strtolower($templatecode),'truncate') !== FALSE ) {
+        if (strpos(strtolower($templatecode), 'delete') !== FALSE ||
+        strpos(strtolower($templatecode), 'drop') !== FALSE ||
+        strpos(strtolower($templatecode), 'truncate') !== FALSE ) {
           $status = -1;
         }
         else {
@@ -104,7 +104,7 @@ function maestro_handle_structure_ajax_request(){
       ->condition('id', $id)
       ->execute();
       $status="0";
-      if($update>=0){
+      if ($update>=0) {
         $status="1";
       }
       $arr=array('id' => $id, 'cntr' => $cntr, 'status' => $status);
@@ -114,9 +114,9 @@ function maestro_handle_structure_ajax_request(){
     case 'createvariable':
       $name=check_plain($_POST['newVariableName']);
       $value=check_plain($_POST['newVariableValue']);
-      $recID=maestro_createTemplateVariable($id, $name, $value);
+      $rec_id = maestro_createTemplateVariable($id, $name, $value);
       $status = 0;
-      if($recID > 0){
+      if ($rec_id > 0) {
         $status = 1;
       }
       $data=theme('maestro_workflow_edit_template_variables',  array('tid' => $id ));
@@ -136,12 +136,12 @@ function maestro_handle_structure_ajax_request(){
       ->execute();
 
       $query = db_select('maestro_template_variables', 'a');
-      $query->fields('a',array('template_id'));
-      $query->condition('a.id',$id,'=');
+      $query->fields('a', array('template_id'));
+      $query->condition('a.id', $id, '=');
       $res=current($query->execute()->fetchAll());
 
       $status="0";
-      if($update>=0){
+      if ($update>=0) {
         $status="1";
       }
       $data=theme('maestro_workflow_edit_template_variables',  array('tid' => $res->template_id ));
@@ -154,7 +154,7 @@ function maestro_handle_structure_ajax_request(){
       $ret=maestro_deleteTemplateVariable($id);
       $data=theme('maestro_workflow_edit_template_variables',  array('tid' => $tid ));
       $status="0";
-      if($ret){
+      if ($ret) {
         $status="1";
       }
       $arr=array('status' => $status, 'data' => $data, 'cntr' => $tid);
@@ -169,29 +169,29 @@ function maestro_handle_structure_ajax_request(){
       break;
 
     case 'showvariables':
-      $data=theme('maestro_workflow_edit_template_variables',  array('tid' => $id ));
-      $arr=array('status' => "1", 'data' => $data, 'cntr' => $id);
+      $data = theme('maestro_workflow_edit_template_variables',  array('tid' => $id ));
+      $arr = array('status' => "1", 'data' => $data, 'cntr' => $id);
       drupal_json_output($arr);
       break;
 
     case 'createtemplate':
-      $name=check_plain($_POST['name']);
-      $recID=maestro_createNewTemplate($name);
+      $name = check_plain($_POST['name']);
+      $rec_id = maestro_createNewTemplate($name);
       $status = 0;
-      if($recID > 0){
+      if ($rec_id > 0) {
         $status = 1;
       }
-      $data=theme('maestro_workflow_list', array('tid' => 0, 'operation' => '' , 'edit_var' => 0));
+      $data = theme('maestro_workflow_list', array('tid' => 0, 'operation' => '' , 'edit_var' => 0));
 
-      $arr=array('status' => $status, 'data' => $data);
+      $arr = array('status' => $status, 'data' => $data);
       drupal_json_output($arr);
       break;
 
     case 'createappgroup':
-      $name=check_plain($_POST['name']);
-      if($name != '')  $recID=maestro_createAppGroup($name);
+      $name = check_plain($_POST['name']);
+      if ($name != '')  $rec_id = maestro_createAppGroup($name);
       $status = 0;
-      if($recID > 0){
+      if ($rec_id > 0) {
         $status = 1;
       }
       $arr=array('status' => $status, 'data' => '');
@@ -214,30 +214,30 @@ function maestro_handle_structure_ajax_request(){
 
     case 'deletetemplate':
       $res=db_query("SELECT id FROM {maestro_template_data} WHERE template_id = :tid", array('tid' => $id));
-      foreach($res as $rec){
+      foreach ($res as $rec) {
         $query = db_delete('maestro_template_assignment');
-        $query->condition('template_data_id',$rec->id,'=');
+        $query->condition('template_data_id', $rec->id, '=');
         $query->execute();
 
         $query = db_delete('maestro_template_notification');
-        $query->condition('template_data_id',$rec->id,'=');
+        $query->condition('template_data_id', $rec->id, '=');
         $query->execute();
 
         $query = db_delete('maestro_template_data_next_step');
-        $query->condition('template_data_from',$rec->id,'=');
+        $query->condition('template_data_from', $rec->id, '=');
         $query->execute();
 
         $query = db_delete('maestro_template_data');
-        $query->condition('id',$rec->id,'=');
+        $query->condition('id', $rec->id, '=');
         $query->execute();
       }
 
       $query = db_delete('maestro_template_variables');
-      $query->condition('template_id',$id,'=');
+      $query->condition('template_id', $id, '=');
       $query->execute();
 
       $query = db_delete('maestro_template');
-      $query->condition('id',$id,'=');
+      $query->condition('id', $id, '=');
       $query->execute();
 
       $data = theme('maestro_workflow_list', array('tid' => 0, 'operation' => '' , 'edit_var' => 0));
@@ -247,33 +247,33 @@ function maestro_handle_structure_ajax_request(){
 
     case 'copytemplate':
       $query = db_select('maestro_template', 'a');
-      $query->fields('a',array('template_name', 'app_group','canvas_height'));
-      $query->condition('a.id',$id,'=');
+      $query->fields('a', array('template_name', 'app_group', 'canvas_height'));
+      $query->condition('a.id', $id, '=');
       $name=current($query->execute()->fetchAll());
       $record = new stdClass();
       $record ->template_name = $name->template_name . " - COPY";
       $record ->app_group = $name->app_group;
       $record ->canvas_height = $name->canvas_height;
       drupal_write_record('maestro_template', $record);
-      $newTID=$record->id;
+      $new_tid=$record->id;
 
       $variable_xref_array = Array();
       $variable_xref_array[0] = 0;
       $res=db_query("SELECT * FROM {maestro_template_variables} WHERE template_id = :tid", array('tid' => $id));
-      foreach($res as $rec) {
+      foreach ($res as $rec) {
         $newrecord = new stdClass();
-        $newrecord->template_id = $newTID;
+        $newrecord->template_id = $new_tid;
         $newrecord->variable_name = $rec->variable_name;
         $newrecord->variable_value = $rec->variable_value;
         drupal_write_record('maestro_template_variables', $newrecord);
         $variable_xref_array[$rec->id] = $newrecord->id;
       }
 
-      $taskDataArray=array();
+      $task_data_array=array();
       $res=db_query("SELECT * FROM {maestro_template_data} WHERE template_id = :tid", array('tid' => $id));
-      foreach($res as $rec) {
+      foreach ($res as $rec) {
         $newrecord = new stdClass();
-        $newrecord->template_id = $newTID;
+        $newrecord->template_id = $new_tid;
         $newrecord->task_class_name = $rec->task_class_name;
         $newrecord->is_interactive = $rec->is_interactive;
 
@@ -322,27 +322,27 @@ function maestro_handle_structure_ajax_request(){
         $newrecord->offset_top = $rec->offset_top;
         $newrecord->surpress_first_notification = $rec->surpress_first_notification;
         drupal_write_record('maestro_template_data', $newrecord);
-        $taskDataArray[$rec->id]= $newrecord->id;
+        $task_data_array[$rec->id]= $newrecord->id;
       }
 
       //at this point, we have a list that points the old ID record to the new one.
       //now for each template data next step, we determine which record to go to/from
       $res=db_query("SELECT * FROM {maestro_template_data} WHERE template_id = :tid", array('tid' => $id));
-      foreach($res as $rec) {
+      foreach ($res as $rec) {
         $nextstepres = db_query("SELECT * FROM {maestro_template_data_next_step} WHERE template_data_from = :id", array('id' => $rec->id));
-        foreach($nextstepres as $nextstep) {
+        foreach ($nextstepres as $nextstep) {
           $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) ";
           $sql .= "VALUES (:a1, :b1, :c1)";
-          db_query($sql, array('a1' => $taskDataArray[$nextstep->template_data_from], 'b1' => $taskDataArray[$nextstep->template_data_to], 'c1' => $taskDataArray[$nextstep->template_data_to_false]));
+          db_query($sql, array('a1' => $task_data_array[$nextstep->template_data_from], 'b1' => $task_data_array[$nextstep->template_data_to], 'c1' => $task_data_array[$nextstep->template_data_to_false]));
         }
 
         $assignmentres = db_query("SELECT * FROM {maestro_template_assignment} WHERE template_data_id = :id", array('id' => $rec->id));
-        foreach($assignmentres as $ares) {
+        foreach ($assignmentres as $ares) {
           $assign_by = $ares->assign_by;
           $modulated_id = intval($ares->assign_id);
-          switch($ares->assign_type) {
+          switch ($ares->assign_type) {
             case MaestroAssignmentTypes::USER:
-              if($assign_by == MaestroAssignmentBy::VARIABLE) {
+              if ($assign_by == MaestroAssignmentBy::VARIABLE) {
                 $modulated_id = $variable_xref_array[$ares->assign_id];
               }
               break;
@@ -358,7 +358,7 @@ function maestro_handle_structure_ajax_request(){
 
           $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) ";
           $sql .= "VALUES (:a1, :b1, :c1, :d1)";
-          db_query($sql, array( 'a1' => $taskDataArray[$ares->template_data_id],
+          db_query($sql, array( 'a1' => $task_data_array[$ares->template_data_id],
                                 'b1' => $ares->assign_type,
                                 'c1' => $ares->assign_by,
                                 'd1' => $modulated_id
@@ -383,7 +383,7 @@ function maestro_admin_form() {
   $form['maestro_batch_script_location'] = array(
     '#type' => 'textfield',
     '#title' => t('Maestro batch script physical file location'),
-    '#default_value' => variable_get('maestro_batch_script_location', drupal_get_path('module','maestro') . "/batch/"),
+    '#default_value' => variable_get('maestro_batch_script_location', drupal_get_path('module', 'maestro') . "/batch/"),
     '#size' => 100,
     '#description' => t('This is the physical directory where the batch scripts are stored.
           It is highly recommended that batch scripts be placed in a directory outside of web root.'),
@@ -417,24 +417,24 @@ function maestro_admin_form() {
   $observers[0] = t("No Notifier");
   foreach (module_implements('maestro_notification_observer') as $module) {
     $function = $module . '_maestro_notification_observer';
-    if ($declaredObserver = $function()) {
-      foreach($declaredObserver as $observer) {
+    if ($declared_observer = $function()) {
+      foreach ($declared_observer as $observer) {
         $obj = new $observer();
         $observers[$observer] = $obj->displayName;
       }
     }
   }
 
-  if(variable_get('maestro_enabled_notifiers') == NULL || (is_array(variable_get('maestro_enabled_notifiers')) && count(variable_get('maestro_enabled_notifiers')) == 0 )  ) {
+  if (variable_get('maestro_enabled_notifiers') == NULL || (is_array(variable_get('maestro_enabled_notifiers')) && count(variable_get('maestro_enabled_notifiers')) == 0 )  ) {
     //this means that all of them should be selected by default
     $x = array();
-    foreach($observers as $key => $val) {
-      if($key != '0') {
+    foreach ($observers as $key => $val) {
+      if ($key != '0') {
         $x[$key] = $key;
       }
     }
 
-    variable_set('maestro_enabled_notifiers',$x);
+    variable_set('maestro_enabled_notifiers', $x);
   }
 
 
@@ -552,7 +552,7 @@ function maestro_admin_form() {
 }
 
 
-function maestro_edit_properties($tid, $var=0){
+function maestro_edit_properties($tid, $var=0) {
   //$tid is the edited template
   return maestro_admin($tid, 'edit', $var);
 }
@@ -562,32 +562,32 @@ function maestro_edit_properties($tid, $var=0){
  * These functions need to exist in order to run unit tests against their functionality.
  */
 
-function maestro_createNewTemplate($name, $skip_task_creation = FALSE, $skip_variable_creation = FALSE, $canvas_height=500){
-  if(!user_access('maestro admin')) return false;
-  if(trim($name) != '') {
+function maestro_createNewTemplate($name, $skip_task_creation = FALSE, $skip_variable_creation = FALSE, $canvas_height=500) {
+  if (!user_access('maestro admin')) return FALSE;
+  if (trim($name) != '') {
     $record = new stdClass();
     $record->template_name = $name;
     $record->canvas_height = $canvas_height;
     drupal_write_record('maestro_template', $record);
-    $newTemplateRecId = $record->id;
-    if(!$skip_task_creation) {
-      $task=new MaestroTaskInterfaceStart(0, $newTemplateRecId);
+    $new_template_rec_id = $record->id;
+    if (!$skip_task_creation) {
+      $task = new MaestroTaskInterfaceStart(0, $new_template_rec_id);
       $task->create();
-      $task=new MaestroTaskInterfaceEnd(0, $newTemplateRecId);
+      $task = new MaestroTaskInterfaceEnd(0, $new_template_rec_id);
       $task->create();
     }
-    if(!$skip_variable_creation) {
-      maestro_createTemplateVariable($newTemplateRecId, 'initiator', '');
+    if (!$skip_variable_creation) {
+      maestro_createTemplateVariable($new_template_rec_id, 'initiator', '');
     }
-    return $newTemplateRecId;
+    return $new_template_rec_id;
   }
   else {
     return FALSE;
   }
 }
 
-function maestro_createTemplateVariable($tid, $name, $value){
-  if(!user_access('maestro admin')) return false;
+function maestro_createTemplateVariable($tid, $name, $value) {
+  if (!user_access('maestro admin')) return FALSE;
   $record = new stdClass();
   $record ->variable_name = $name;
   $record ->variable_value = $value;
@@ -596,41 +596,41 @@ function maestro_createTemplateVariable($tid, $name, $value){
   return $record->id;
 }
 
-function maestro_deleteTemplateVariable($id){
-  if(!user_access('maestro admin')) return false;
+function maestro_deleteTemplateVariable($id) {
+  if (!user_access('maestro admin')) return FALSE;
   $query = db_select('maestro_template_variables', 'a');
-  $query->fields('a',array('variable_name'));
+  $query->fields('a', array('variable_name'));
   $query->condition('a.id', $id, '=');
   $name=current($query->execute()->fetchAll());
-  if($name->variable_name != 'initiator') {
+  if ($name->variable_name != 'initiator') {
     $query = db_delete('maestro_template_variables');
     $query->condition('id', $id, '=');
     $query->execute();
-    return true;
+    return TRUE;
   }
   else {
-    return false;
+    return FALSE;
   }
 
 }
 
-function maestro_createAppGroup($name){
-  if(!user_access('maestro admin')) return false;
+function maestro_createAppGroup($name) {
+  if (!user_access('maestro admin')) return FALSE;
   $record = new stdClass();
   $record ->app_group = $name;
   drupal_write_record('maestro_app_groups', $record);
   return $record->id;
 }
 
-function maestro_deleteAppGroup($id){
-  if(!user_access('maestro admin')) return false;
+function maestro_deleteAppGroup($id) {
+  if (!user_access('maestro admin')) return FALSE;
   $query = db_delete('maestro_app_groups');
   $query->condition('id', $id, '=');
   $query->execute();
 }
 
 function maestro_joinAppGroup($template_id, $appgroup_id) {
-  if(!user_access('maestro admin')) return false;
+  if (!user_access('maestro admin')) return FALSE;
   $update = db_update('maestro_template')
   ->fields(array( 'app_group' => $appgroup_id
   ))
@@ -641,7 +641,7 @@ function maestro_joinAppGroup($template_id, $appgroup_id) {
 function maestro_export($id) {
   $output_php = "";
   $id=intval($id);
-  if($id > 0) {
+  if ($id > 0) {
     //first step -- fetch the name of the original template
     $output_php .= '$_POST[\'offset_top\'] = 0;' . "\n";
     $output_php .= '$_POST[\'offset_left\'] = 0;' . "\n";
@@ -650,8 +650,8 @@ function maestro_export($id) {
     $output_php .= '$task_xref_array = Array();' . "\n";
     $output_php .= '$task_xref_array[0] = 0;' . "\n";
     $query = db_select('maestro_template', 'a');
-    $query->fields('a',array('template_name', 'canvas_height'));
-    $query->condition('a.id',$id,'=');
+    $query->fields('a', array('template_name', 'canvas_height'));
+    $query->condition('a.id', $id, '=');
     $name=current($query->execute()->fetchAll());
     $original_template_name = str_replace('"', '\"', $name->template_name);
     $canvas_height = $name->canvas_height;
@@ -659,17 +659,17 @@ function maestro_export($id) {
     //lets get all of the template variables:
     $template_variables_record_set=db_query("SELECT * FROM {maestro_template_variables} WHERE template_id = :tid", array('tid' => $id));
     $initiator_variable_id=0;
-    foreach($template_variables_record_set as $rec) {
+    foreach ($template_variables_record_set as $rec) {
       $var_name = str_replace('"', '\"', $rec->variable_name);
       $var_value = str_replace('"', '\"', $rec->variable_value);
-      if($rec->variable_name == 'initiator') {
+      if ($rec->variable_name == 'initiator') {
         $initiator_variable_id = $rec->id;
       }
       $output_php .= '$variable_xref_array[' . $rec->id . '] = maestro_createTemplateVariable($templateID, "' . $var_name . '", "' . $var_value . '");' . "\n";
     }
     //lets get all of the template_data entries
     $template_data_record_set=db_query("SELECT * FROM {maestro_template_data} WHERE template_id = :tid", array('tid' => $id));
-    foreach($template_data_record_set as $rec) {
+    foreach ($template_data_record_set as $rec) {
       $task_type = substr($rec->task_class_name, 15);
       $task_class = 'MaestroTaskInterface' . $task_type;
       $output_php .= '$ti = new ' . $task_class . '(0, $templateID);' . "\n";
@@ -679,17 +679,17 @@ function maestro_export($id) {
       $output_php .= '$res->fields(\'a\', array(\'id\', \'task_data\'));' . "\n";
       $output_php .= '$res->condition(\'a.id\', $ti->get_task_id(), \'=\');' . "\n";
       $output_php .= '$rec = current($res->execute()->fetchAll());' . "\n";
-      foreach($rec as $key => $data){
-        if($key!='id' && $key!='task_class_name' && $key!='template_id') {
-          if($key == 'task_data') {
+      foreach ($rec as $key => $data) {
+        if ($key != 'id' && $key != 'task_class_name' && $key != 'template_id') {
+          if ($key == 'task_data') {
             $output_php .= '$fixed_data = $ti->modulateExportTaskData(\'' . str_replace("'", "\'", $data) . '\', $variable_xref_array);' . "\n";
-            $output_php .='$rec->task_data = $fixed_data;' . "\n";
+            $output_php .= '$rec->task_data = $fixed_data;' . "\n";
           }
-          elseif(is_numeric($data)) {
-            $output_php .='$rec->' . $key . ' = ' . $data . ';' . "\n";
+          elseif (is_numeric($data)) {
+            $output_php .= '$rec->' . $key . ' = ' . $data . ';' . "\n";
           }
           else {
-            $output_php .='$rec->' . $key . ' = \'' . $data . '\';' . "\n";
+            $output_php .= '$rec->' . $key . ' = \'' . $data . '\';' . "\n";
           }
         }
       }
@@ -697,83 +697,83 @@ function maestro_export($id) {
     }
     //we now have to create the next step and assignmnents
     $template_data_record_set=db_query("SELECT * FROM {maestro_template_data} WHERE template_id = :tid", array('tid' => $id));
-    foreach($template_data_record_set as $rec) {
+    foreach ($template_data_record_set as $rec) {
       $nextstepres = db_query("SELECT * FROM {maestro_template_data_next_step} WHERE template_data_from = :id", array('id' => $rec->id));
-      foreach($nextstepres as $nextstep) {
-        $output_php .='$sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";' . "\n";
-        $output_php .='db_query($sql, array(\'a1\' => $task_xref_array[' . $nextstep->template_data_from . '], \'b1\' => $task_xref_array[' . $nextstep->template_data_to . '], \'c1\' => $task_xref_array[' . $nextstep->template_data_to_false . ']));' . "\n";
+      foreach ($nextstepres as $nextstep) {
+        $output_php .= '$sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";' . "\n";
+        $output_php .= 'db_query($sql, array(\'a1\' => $task_xref_array[' . $nextstep->template_data_from . '], \'b1\' => $task_xref_array[' . $nextstep->template_data_to . '], \'c1\' => $task_xref_array[' . $nextstep->template_data_to_false . ']));' . "\n";
       }
       $assignmentres = db_query("SELECT * FROM {maestro_template_assignment} WHERE template_data_id = :id", array('id' => $rec->id));
-      foreach($assignmentres as $ares) {
-        $output_php .='$query = db_select(\'maestro_template_data\', \'a\');' . "\n";
-        $output_php .='$query->fields(\'a\',array(\'task_class_name\'));' . "\n";
-        $output_php .='$query->condition(\'a.id\',$task_xref_array[' . $ares->template_data_id . '],\'=\');' . "\n";
-        $output_php .='$name=current($query->execute()->fetchAll());'. "\n";
-        $output_php .='$task_type = substr($name->task_class_name, 15);' . "\n";
-        $output_php .='$task_class = \'MaestroTaskInterface\' . $task_type;' . "\n";
-        $output_php .='$ti = new $task_class(0,0);' . "\n";
+      foreach ($assignmentres as $ares) {
+        $output_php .= '$query = db_select(\'maestro_template_data\', \'a\');' . "\n";
+        $output_php .= '$query->fields(\'a\',array(\'task_class_name\'));' . "\n";
+        $output_php .= '$query->condition(\'a.id\',$task_xref_array[' . $ares->template_data_id . '],\'=\');' . "\n";
+        $output_php .= '$name=current($query->execute()->fetchAll());' . "\n";
+        $output_php .= '$task_type = substr($name->task_class_name, 15);' . "\n";
+        $output_php .= '$task_class = \'MaestroTaskInterface\' . $task_type;' . "\n";
+        $output_php .= '$ti = new $task_class(0,0);' . "\n";
 
         //we'll just make an initial assumption that the assign_by is by variable
         //we overwrite this in the switch if it is actually by a fixed value
         $assign_by = $ares->assign_by;
         $assign_type = $ares->assign_type;
-        $output_php .='$assign_by = ' . $assign_by . ";\n";
-        $output_php .='$assign_type = ' . $assign_type . ";\n";
+        $output_php .= '$assign_by = ' . $assign_by . ";\n";
+        $output_php .= '$assign_type = ' . $assign_type . ";\n";
 
         $modulated_string = '$modulated_id = $variable_xref_array[' . intval($ares->assign_id) . '];' . "\n";
-        switch($ares->assign_type) {
+        switch ($ares->assign_type) {
           case MaestroAssignmentTypes::USER:
-            if($assign_by == MaestroAssignmentBy::FIXED) {
+            if ($assign_by == MaestroAssignmentBy::FIXED) {
               $temp_user_info = user_load($ares->assign_id);
-              $modulated_string ='$modulated_id = $ti->modulateExportUser("' . $temp_user_info->name . '");' . "\n";
+              $modulated_string = '$modulated_id = $ti->modulateExportUser("' . $temp_user_info->name . '");' . "\n";
             }
             break;
 
           case MaestroAssignmentTypes::GROUP:
-            if($assign_by == MaestroAssignmentBy::FIXED) {
-              if(module_exists('og')) {
+            if ($assign_by == MaestroAssignmentBy::FIXED) {
+              if (module_exists('og')) {
                 $query = db_select('og', 'a');
-                $query->addField('a','label');
-                $query->condition('a.gid', intval($ares->assign_id),'=');
+                $query->addField('a', 'label');
+                $query->condition('a.gid', intval($ares->assign_id), '=');
                 $group = $query->execute()->fetchField();
-                $modulated_string  ='$modulated_id = $ti->modulateExportOG("' . $group . '");' . "\n";
-                $modulated_string .='if($modulated_id == FALSE) {'. "\n";
-                $modulated_string .='  $assign_by = ' . MaestroAssignmentBy::VARIABLE . ";\n";
-                $modulated_string .='  $assign_type = ' . MaestroAssignmentTypes::USER . ";\n";
-                $modulated_string .='  $modulated_id = ' . $initiator_variable_id . ';' . "\n";
-                $modulated_string .="}\n";
+                $modulated_string  = '$modulated_id = $ti->modulateExportOG("' . $group . '");' . "\n";
+                $modulated_string .= 'if ($modulated_id == FALSE) {' . "\n";
+                $modulated_string .= '  $assign_by = ' . MaestroAssignmentBy::VARIABLE . ";\n";
+                $modulated_string .= '  $assign_type = ' . MaestroAssignmentTypes::USER . ";\n";
+                $modulated_string .= '  $modulated_id = ' . $initiator_variable_id . ';' . "\n";
+                $modulated_string .= "}\n";
               }
               else { //we are going to simply set this to the initiator variable
                   //This would be an odd situation here, but this is the EXPORT noticing that og isnt installed but yet the
                   //template they are exporting is trying to export an OG reference.  IMPOSSIBLE!  But yet, because OG could conceivably
                   //be disabled/uninstalled by accident, exports of a template shouldn't suffer.
-                watchdog('maestro import', t('You do not have OG installed.  Task assignment changed to assigned by INITIATOR variable.'));
-                $modulated_string  ='$assign_by = ' . MaestroAssignmentBy::VARIABLE . ";\n";
-                $modulated_string .='$assign_type = ' . MaestroAssignmentTypes::USER . ";\n";
-                $modulated_string .='$modulated_id = ' . $initiator_variable_id . ';' . "\n";
+                watchdog('maestro import', 'You do not have OG installed.  Task assignment changed to assigned by INITIATOR variable.');
+                $modulated_string  = '$assign_by = ' . MaestroAssignmentBy::VARIABLE . ";\n";
+                $modulated_string .= '$assign_type = ' . MaestroAssignmentTypes::USER . ";\n";
+                $modulated_string .= '$modulated_id = ' . $initiator_variable_id . ';' . "\n";
               }
             }
             break;
 
           case MaestroAssignmentTypes::ROLE:
-            if($assign_by == MaestroAssignmentBy::FIXED) {
+            if ($assign_by == MaestroAssignmentBy::FIXED) {
             $query = db_select('role', 'a');
-            $query->addField('a','name');
-            $query->condition('a.rid', intval($ares->assign_id),'=');
+            $query->addField('a', 'name');
+            $query->condition('a.rid', intval($ares->assign_id), '=');
             $role = $query->execute()->fetchField();
-            $modulated_string ='$modulated_id = $ti->modulateExportRole("' . $role . '");' . "\n";
+            $modulated_string = '$modulated_id = $ti->modulateExportRole("' . $role . '");' . "\n";
             }
             break;
         }
 
         $output_php .= $modulated_string;
 
-        $output_php .='$sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";' . "\n";
-        $output_php .='db_query($sql, array( \'a1\' => $task_xref_array[' . $ares->template_data_id . '],';
-        $output_php .='\'b1\' => $assign_type,';
-        $output_php .='\'c1\' => $assign_by,';
-        $output_php .='\'d1\' => $modulated_id,';
-        $output_php .='));' . "\n";
+        $output_php .= '$sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";' . "\n";
+        $output_php .= 'db_query($sql, array( \'a1\' => $task_xref_array[' . $ares->template_data_id . '],';
+        $output_php .= '\'b1\' => $assign_type,';
+        $output_php .= '\'c1\' => $assign_by,';
+        $output_php .= '\'d1\' => $modulated_id,';
+        $output_php .= '));' . "\n";
 
       }
     }
@@ -781,7 +781,7 @@ function maestro_export($id) {
   return $output_php;
 }
 
-function maestro_export_template($tid, $var=0){
+function maestro_export_template($tid, $var=0) {
   $content=maestro_export($tid);
   return maestro_admin($tid, 'export_template', $var);
 }
\ No newline at end of file
diff --git a/maestro.install b/maestro.install
index 7755956..5458f6c 100644
--- a/maestro.install
+++ b/maestro.install
@@ -932,7 +932,7 @@ function maestro_schema() {
         'type' => 'int',
         'not null' => FALSE,
       ),
-      'instance'=> array(
+      'instance' => array(
         'description' => 'Instance of this content type for this project',
         'type' => 'int',
         'not null' => TRUE,
@@ -985,7 +985,7 @@ function maestro_schema() {
 function maestro_update_7001() {
 
   db_add_field('maestro_production_assignments', 'assign_type', array('type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => '0', 'description' => 'assign by user, role or group'));
-  db_drop_unique_key('maestro_production_assignments','assign_back_uid');
+  db_drop_unique_key('maestro_production_assignments', 'assign_back_uid');
   db_change_field('maestro_production_assignments', 'assign_back_uid', 'assign_back_id',
       array('type' => 'int', 'not null' => TRUE, 'default' => '0'),
       array('unique key' => array('assign_back_id')));
diff --git a/maestro.moderator.inc b/maestro.moderator.inc
index 2ab6d06..fd50b98 100644
--- a/maestro.moderator.inc
+++ b/maestro.moderator.inc
@@ -1,9 +1,9 @@
 <?php
 
 /**
-* @file
-* maestro.moderator.inc
-*/
+ * @file
+ * maestro.moderator.inc
+ */
 
 function maestro_outstanding_tasks($op='', $qid=0, $other=NULL) {
   global $base_url;
@@ -22,12 +22,12 @@ function maestro_outstanding_tasks($op='', $qid=0, $other=NULL) {
   switch ($op) {
     case 'reassign':
       $m->reassignTask($qid, $_POST['reassign_id'], $_POST['current_uid']);
-      drupal_set_message("Task re-assignment completed and notification sent.");
+      drupal_set_message(t("Task re-assignment completed and notification sent."));
       break;
 
     case 'email':
       $m->sendTaskReminderNotifications($qid, $other);
-      drupal_set_message("Task assignment reminder notification sent.");
+      drupal_set_message(t("Task assignment reminder notification sent."));
       break;
 
     case 'trace':
@@ -222,7 +222,7 @@ function maestro_my_flows() {
   drupal_add_js($base_url . $maestro_path . '/js/taskconsole.js');
   $ajax_url = url('maestro/taskconsole/ajax')  ;
   $filter = array(
-  'myflows' => true,
+  'myflows' => TRUE,
   );
   $rows = maestro_get_all_flows_data($filter);  //user as a filter
   return theme('maestro_all_flows', array('ajax_url' => $ajax_url , 'filter_url' => $ajax_url . '/myflows', 'database_result_set' => $rows));
@@ -248,11 +248,11 @@ function maestro_get_all_flows_data($filters = NULL) {
   //$query->orderBy('d.id','DESC');
   //$query->limit(1);
 
-  if(is_array($filters)) {
-    foreach($filters as $key => $filter) {
-      if(isset($filter) && $filter !=''){
+  if (is_array($filters)) {
+    foreach ($filters as $key => $filter) {
+      if (isset($filter) && $filter !='') {
 
-        switch($key) {
+        switch ($key) {
           case 'userid':
             $query->condition(db_or()->condition('a.originator_uid', intval($filter))->condition('e.uid', intval($filter)));
             break;
diff --git a/maestro.module b/maestro.module
index 770225d..e6f38a9 100644
--- a/maestro.module
+++ b/maestro.module
@@ -187,7 +187,7 @@ function maestro_help($path, $arg) {
 
   switch ($path) {
     case "admin/help#maestro":
-      $output = '<p>' . t("Define and administer workflows.") .'</p>';
+      $output = '<p>' . t("Define and administer workflows.") . '</p>';
       break;
   }
   return $output;
@@ -230,11 +230,11 @@ function maestro_theme() {
     ),
     'maestro_taskconsole_details' => array(
       'template' => 'theme/project_detail_container',
-      'variables' => array('task' => NULL,'source' => NULL),
+      'variables' => array('task' => NULL, 'source' => NULL),
       ),
     'maestro_project_comments' => array(
       'template' => 'theme/project_detail_comments',
-      'variables' => array('rowid' => NULL,'tracking_id' => NULL),
+      'variables' => array('rowid' => NULL, 'tracking_id' => NULL),
       ),
     'maestro_trace' => array(
       'template' => 'theme/maestro-trace',
@@ -380,7 +380,7 @@ function maestro_action_info() {
       'type' => 'maestro',
       'label' => t('Launch a Maestro Workflow'),
       'configurable' => TRUE,
-      'triggers' => array ('any'),
+      'triggers' => array('any'),
     )
   );
 }
@@ -416,7 +416,7 @@ function launch_workflow_action(&$object, $context = array()) {
     $nid = intval($context['node']->nid);
     //why bother even running this if the nid is zero?
     //this is a fix for triggering on a node_presave where there isn't a nid
-    if($nid>0) {
+    if ($nid>0) {
       $query = db_insert('maestro_project_content');
       $query->fields(array('nid', 'tracking_id', 'task_id', 'instance', 'content_type', 'task_data', 'created_by_uid', 'is_locked_by_uid', 'status'));
       $query->values(array(
@@ -527,7 +527,7 @@ function maestro_taskconsole() {
   //Only run the orchestrator if we've been told to do so on the config page.
   //if this is our initial installation, set the default value to 1
   //to allow the orchestrator to clean the queue properly
-  if(variable_get('maestro_run_orchestrator_in_task_console', 1)){
+  if (variable_get('maestro_run_orchestrator_in_task_console', 1)) {
     $maestro->engine()->cleanQueue();
   }
 
@@ -546,19 +546,20 @@ function maestro_taskconsole() {
 function maestro_launch_workflow($template=0) {
   global $base_url;
 
-  $template = intval ($template);
+  $template = intval($template);
   if ($template > 0) {
     $maestro = Maestro::createMaestroObject(1);
     $newprocess = $maestro->engine()->newProcess($template);
 
     if ($newprocess > 0) {
-      drupal_set_message("New Process Code Success! - Process ID: $newprocess");
-    } else {
-      drupal_set_message("New Process Code FAIL! - Template: $template not defined");
+      drupal_set_message(t("New Process Code Success! - Process ID: @process", array('@process' => check_plain($newprocess))));
+    } 
+    else {
+      drupal_set_message(t("New Process Code FAIL! - Template: @template not defined", array('@template' => check_plain($template))));
     }
   }
   else {
-    drupal_set_message("New Process Code FAIL! - No Template ID Given");
+    drupal_set_message(t("New Process Code FAIL! - No Template ID Given"));
   }
 
   return $newprocess;
@@ -576,19 +577,20 @@ function maestro_launch_workflow($template=0) {
 function maestro_new_process($template=0) {
   global $base_url;
 
-  $template = intval ($template);
+  $template = intval($template);
   if ($template > 0) {
     $maestro = Maestro::createMaestroObject(1);
     $newprocess = $maestro->engine()->newProcess($template);
 
     if ($newprocess > 0) {
-      drupal_set_message("New Process Code Success! - Process ID: $newprocess");
-    } else {
-      drupal_set_message("New Process Code FAIL! - Template: $template not defined");
+      drupal_set_message(t("New Process Code Success! - Process ID: @process", array('@process' => check_plain($newprocess))));
+    } 
+    else {
+      drupal_set_message(t("New Process Code FAIL! - Template: @template not defined", array('@template' => check_plain($template))));
     }
   }
   else {
-    drupal_set_message("New Process Code FAIL! - No Template ID Given");
+    drupal_set_message(t("New Process Code FAIL! - No Template ID Given"));
   }
 
   drupal_goto('maestro/taskconsole');
@@ -629,14 +631,15 @@ function template_preprocess_maestro_taskconsole(&$variables) {
       $formatted_task->task_action_url = '#';  //we let the interactive tasks override this later if need be.
 
       if ($task->dates['started'] > 0) {
-        $formatted_task->task_started = ', Started: ' . format_date($task->dates['started'],'short');
+        $formatted_task->task_started = ', Started: ' . format_date($task->dates['started'], 'short');
         $formatted_task->task_icon = $maestro_path . '/images/taskconsole/task.gif';
-      } else {
+      } 
+      else {
         $formatted_task->task_started = '';
         $formatted_task->task_icon = $maestro_path . '/images/taskconsole/new_task.gif';
       }
-      $formatted_task->assigned_shortdate = format_date($task->dates['created'],'custom','m/d/y');
-      $formatted_task->assigned_longdate = format_date($task->dates['created'],'medium');
+      $formatted_task->assigned_shortdate = format_date($task->dates['created'], 'custom', 'm/d/y');
+      $formatted_task->assigned_longdate = format_date($task->dates['created'], 'medium');
       $formatted_task->project_details = '';
 
       // Determine if this task is for a regenerated workflow and we need to update the main project/request record
@@ -647,13 +650,15 @@ function template_preprocess_maestro_taskconsole(&$variables) {
       if ($task->flags['is_interactive'] == 1) {
         $current_task = new $task->tasktype($task);  //fire up the engine task here to let us re-use its methods to create task console output.
         $formatted_task->task_action_url = $current_task->getTaskConsoleURL();  //here is where we override the action url.
-        $action_record = $maestro->engine()->showInteractiveTask($current_task,$task->queue_id);
+        $action_record = $maestro->engine()->showInteractiveTask($current_task, $task->queue_id);
         if ($action_record === FALSE OR empty($action_record)) {
           $formatted_task->action_record = '';
-        } else {
+        } 
+        else {
           $formatted_task->action_record = $action_record;
         }
-      } else {
+      } 
+      else {
         $formatted_task->action_record = '';
       }
 
@@ -683,7 +688,7 @@ function template_preprocess_maestro_taskconsole(&$variables) {
  * Preprocess function for details displayed on task console
  */
 function template_preprocess_maestro_taskconsole_details(&$variables) {
-  global $base_url,$user;
+  global $base_url, $user;
 
   $task = $variables['task'];
   $variables['base_url'] = $base_url;
@@ -698,13 +703,14 @@ function template_preprocess_maestro_taskconsole_details(&$variables) {
   if (user_access('maestro reassign tasks')) {
     $variables['workflow_admin'] = TRUE;
     $variables['show_otaskaction'] = '';
-  } else {
+  } 
+  else {
     $variables['workflow_admin'] = FALSE;
     $variables['show_otaskaction'] = 'none';
   }
 
-  $projectRec = db_select('maestro_projects','a')
-  ->fields('a',array('project_num','originator_uid','description','status','prev_status','related_processes'))
+  $projectRec = db_select('maestro_projects', 'a')
+  ->fields('a', array('project_num', 'originator_uid', 'description', 'status', 'prev_status', 'related_processes'))
   ->condition('id', $task->tracking_id, '=')
   ->execute()->fetchObject();
 
@@ -719,7 +725,8 @@ function template_preprocess_maestro_taskconsole_details(&$variables) {
 
   if (user_access('maestro admin')) {
     $variables['delete_project_action'] = '<a href="#" onClick="maestro_ajaxDeleteProject(' . $task->tracking_id . ', \'' . t('Confirm you would like to delete this project.') . '\');return false;">' . t('Delete Project') . '</a>';
-  } else {
+  }
+  else {
     $variables['delete_project_action'] = '';
   }
 
@@ -727,29 +734,29 @@ function template_preprocess_maestro_taskconsole_details(&$variables) {
 
   /* Format Outstanding Tasks Object to be used in the template */
   $arr_otasks = array();  // Array of outstanding task objects
-  $query = db_select('maestro_process','process');
+  $query = db_select('maestro_process', 'process');
   $query->join('maestro_queue', 'queue', 'queue.process_id = process.id');
   $query->join('maestro_template_data', 'template', 'queue.template_data_id = template.id');
   $query->join('maestro_production_assignments', 'assignment', 'assignment.task_id = queue.id');
   $query->leftJoin('users', 'user', 'user.uid = assignment.assign_id');
   $query->leftJoin('role', 'role', 'role.rid = assignment.assign_id');
-  $query->fields('queue', array('process_id','created_date','started_date','completed_date','status'));
-  $query->fields('template', array('taskname','is_dynamic_taskname','dynamic_taskname_variable_id'));
-  $query->fields('assignment', array('assign_id','assign_type','process_variable'));
-  $query->addField('assignment','id','assign_recid');
-  $query->addField('queue','id','queue_id');
-  $query->addField('user','name','username');
-  $query->addField('role','name','rolename');
-  $query->addField('process','pid','parent_process_id');
-  $query->addField('process','tracking_id','tracking_id');
+  $query->fields('queue', array('process_id', 'created_date', 'started_date', 'completed_date', 'status'));
+  $query->fields('template', array('taskname', 'is_dynamic_taskname', 'dynamic_taskname_variable_id'));
+  $query->fields('assignment', array('assign_id', 'assign_type', 'process_variable'));
+  $query->addField('assignment', 'id', 'assign_recid');
+  $query->addField('queue', 'id', 'queue_id');
+  $query->addField('user', 'name', 'username');
+  $query->addField('role', 'name', 'rolename');
+  $query->addField('process', 'pid', 'parent_process_id');
+  $query->addField('process', 'tracking_id', 'tracking_id');
   $query->condition('process.tracking_id', $task->tracking_id, '=');
-  $query->condition('queue.status',0,'=');
-  $query->condition('queue.show_in_detail',1,'=');
+  $query->condition('queue.status', 0, '=');
+  $query->condition('queue.show_in_detail', 1, '=');
   $res = $query->execute();
   $variables['outstanding_tasks'] = array(); //instantiate empty array just in case the query returns no results
   foreach ($res as $record) {
     $otask = new stdClass();
-    $otask->assigned_date = strftime("%b %d/%Y %H:%M",$record->created_date);
+    $otask->assigned_date = strftime("%b %d/%Y %H:%M", $record->created_date);
     $otask->task_id = $record->queue_id;
     if ($record->parent_process_id > 0) $record->taskname = '<span style="color:red;padding-right:3px;">[R]</span>' . $record->taskname;
     $otask->taskname = $record->taskname;
@@ -762,12 +769,13 @@ function template_preprocess_maestro_taskconsole_details(&$variables) {
         break;
       case MaestroAssignmentTypes::ROLE:
         // Test if group name has been set to use a variable for this task
-        if($record->assign_id == 0 AND $record->process_variable > 0) {
+        if ($record->assign_id == 0 AND $record->process_variable > 0) {
           $maestro = Maestro::createMaestroObject(1);    // Initiate the processing of all tasks of type 1.x
           // The process variable is expected to contain the role name
           $process_variable = $maestro->engine()->getProcessVariable($record->process_variable, $record->process_id);
           $otask->owner = "R:{$process_variable}";
-        } else {
+        } 
+        else {
           $otask->owner = "R:{$record->rolename}";
         }
         $otask->assignment_type = 'role';
@@ -775,16 +783,18 @@ function template_preprocess_maestro_taskconsole_details(&$variables) {
       case MaestroAssignmentTypes::GROUP:
         if (module_exists('og')) {
           // Test if group name has been set to use a variable for this task
-          if($record->assign_id == 0 AND $record->process_variable > 0) {
+          if ($record->assign_id == 0 AND $record->process_variable > 0) {
             $maestro = Maestro::createMaestroObject(1);    // Initiate the processing of all tasks of type 1.x
             // The process variable is expected to contain the group name
             $process_variable = $maestro->engine()->getProcessVariable($record->process_variable, $record->process_id);
             $otask->owner = "G:{$process_variable}";
-          } else {
+          } 
+          else {
             $og_groupinfo = og_label_multiple(array($record->assign_id));
             $otask->owner = "G:{$og_groupinfo[$record->assign_id]}";
           }
-        } else {
+        } 
+        else {
           $otask->owner = "G:OG Disabled";
         }
         $otask->assignment_type = 'group';
@@ -793,14 +803,15 @@ function template_preprocess_maestro_taskconsole_details(&$variables) {
     $otask->variable_id = $record->process_variable;
     if ($otask->variable_id > 0) {
       $otask->taskassign_mode = 'variable';
-    } else {
+    } 
+    else {
       $otask->taskassign_mode = 'id';  // User ID or Role ID or Group ID
     }
     $variables['outstanding_tasks'][] = $otask;
   }
 
-  $res = db_select('users','users')
-  ->fields('users', array('uid','name'))
+  $res = db_select('users', 'users')
+  ->fields('users', array('uid', 'name'))
   ->condition('uid', 0, '>')
   ->execute();
   foreach ($res as $rec) {
@@ -809,25 +820,24 @@ function template_preprocess_maestro_taskconsole_details(&$variables) {
 
   /* For each task - check and see if they have any formatted content to display */
   $variables['content_records'] = array();
-  $query = db_select('maestro_process','process');
+  $query = db_select('maestro_process', 'process');
   $query->join('maestro_queue', 'queue', 'queue.process_id = process.id');
-  $query->fields('queue', array('id','process_id','template_data_id','task_class_name'));
-  $query->addField('queue','id','queue_id');
+  $query->fields('queue', array('id', 'process_id', 'template_data_id', 'task_class_name'));
+  $query->addField('queue', 'id', 'queue_id');
   $query->condition('process.tracking_id', $task->tracking_id, '=');
   $res = $query->execute();
   $uniqueTasks = array();
   foreach ($res as $taskrec) {
     // Only need to call this task method once for each template task step - added in case of regen instances
-    if(!in_array($taskrec->template_data_id,$uniqueTasks)) {
+    if (!in_array($taskrec->template_data_id, $uniqueTasks)) {
       $uniqueTasks[] = $taskrec->template_data_id;
       $current_task = new $taskrec->task_class_name();
-      $taskContent = $current_task->showContentDetail($task->tracking_id,$taskrec->id);
+      $taskContent = $current_task->showContentDetail($task->tracking_id, $taskrec->id);
       if (!empty($taskContent)) {
         $variables['content_records'][] = $taskContent;
       }
     }
   }
-
 }
 
 /**
@@ -841,26 +851,28 @@ function template_preprocess_maestro_project_comments(&$variables) {
 
   /* Format any project comments records */
   $variables['comment_records'] = array();
-  $query = db_select('maestro_project_comments','a');
-  $query->fields('a',array('id','uid','timestamp','comment'));
-  $query->join('users','b','b.uid = a.uid');
-  $query->addField('b','name','username');
-  $query->condition('a.tracking_id',$variables['tracking_id'],'=');
+  $query = db_select('maestro_project_comments', 'a');
+  $query->fields('a', array('id', 'uid', 'timestamp', 'comment'));
+  $query->join('users', 'b', 'b.uid = a.uid');
+  $query->addField('b', 'name', 'username');
+  $query->condition('a.tracking_id', $variables['tracking_id'], '=');
   $res = $query->execute();
   foreach ($res as $record) {
     if (isset($record->task_id) AND $record->task_id > 0) {
-    $query = db_select('maestro_queue','a');
-    $query->join('maestro_template_data','b','b.id = a.template_data_id');
-    $query->addField('b','taskname','taskname');
-    $query->condition('a.id',$record->task_id,'=');
+    $query = db_select('maestro_queue', 'a');
+    $query->join('maestro_template_data', 'b', 'b.id = a.template_data_id');
+    $query->addField('b', 'taskname', 'taskname');
+    $query->condition('a.id', $record->task_id, '=');
     $record->taskname = $query->execute()->fetchField();
-    } else {
+    } 
+    else {
       $record->taskname = t('N/A');
     }
-    $record->date = strftime("%b %d/%Y %H:%M",$record->timestamp);
+    $record->date = strftime("%b %d/%Y %H:%M", $record->timestamp);
     if ($record->uid == $user->uid OR user_access('maestro admin')) {
       $record->show_delete = 'visible';
-    } else {
+    } 
+    else {
       $record->show_delete = 'hidden';
     }
     $variables['comment_records'][] = $record;
@@ -884,7 +896,7 @@ function template_preprocess_maestro_workflow_edit(&$variables) {
  */
 function template_preprocess_maestro_workflow_list(&$variables) {
   $query = db_select('maestro_template', 'a');
-  $query->addExpression('COUNT(a.id)','templateCount');
+  $query->addExpression('COUNT(a.id)', 'templateCount');
   $queryNumRows = $query->countQuery()->execute()->fetchField();
   $variables['num_records'] = intval($queryNumRows);
   $output="";
@@ -922,8 +934,8 @@ function template_preprocess_maestro_workflow_list_item(&$variables) {
     $variables['show_item'] = '';
     $output=theme('maestro_workflow_edit_template_variables',  array('tid' => $variables['tid'], 'edit_var' => $variables['edit_var'] , 'cntr' => $variables['cntr']));
     $query = db_select('maestro_template', 'a');
-    $query->fields('a',array('template_name','app_group'));
-    $query->condition('a.id',$variables['tid'],'=');
+    $query->fields('a', array('template_name', 'app_group'));
+    $query->condition('a.id', $variables['tid'], '=');
     $res=current($query->execute()->fetchAll());
     $variables['template_app_groups'] = maestro_createAppGroupDropDown('appGroup', $res->app_group);
   }
@@ -965,7 +977,7 @@ function template_preprocess_maestro_workflow_edit_template_variables(&$variable
 function template_preprocess_maestro_workflow_edit_template_variables_list(&$variables) {
   global $base_url;
   $variables['module_path' ] = $base_url . "/" . drupal_get_path('module', 'maestro');
-  if($variables['var_id'] == $variables['edit_var']) {
+  if ($variables['var_id'] == $variables['edit_var']) {
     $variables['show_variable_actions'] = 'none';
     $variables['show_variable_edit_actions'] = '';
   }
@@ -983,13 +995,13 @@ function template_preprocess_maestro_workflow_edit_template_variables_list(&$var
  * @return
  *  HTML of select list
  */
-function maestro_createAppGroupDropDown($name, $selected = 0){
+function maestro_createAppGroupDropDown($name, $selected = 0) {
   $res = db_query("SELECT id, app_group FROM {maestro_app_groups}");
   $output = "<select class='form-select' id='{$name}' name='{$name}' size='4' >";
   $output .= "<option value='0'>" . t('N/A') . "</option>";
   foreach ($res as $rec) {
     $sel = "";
-    if($selected == $rec->id) $sel = " selected ";
+    if ($selected == $rec->id) $sel = " selected ";
     $output .= "<option value='{$rec->id}' {$sel}>{$rec->app_group}</option>";
   }
   $output .= "</select>";
@@ -1070,15 +1082,15 @@ function maestro_maestro_handler_options() {
 */
 function maestro_maestro_set_process_variable_methods() {
   return array(
-    'hardcoded_value' => array (
+    'hardcoded_value' => array(
       'title' => t('Hardcoded Value'),
       'engine_handler' => 'maestro_set_process_variable_logic_hardcoded',
     ),
-    'increment_value' => array (
+    'increment_value' => array(
       'title' => t('Add or Subtract a Value') . '<br>' . t('(negative number for subtraction)'),
       'engine_handler' => 'maestro_set_process_variable_logic_increment',
     ),
-    'maestro_content_type_task' => array (
+    'maestro_content_type_task' => array(
       'title' => t('Content Field Result'),
       'engine_handler' => 'content_type_task_maestro_set_process_variable_logic',
     ),
@@ -1116,11 +1128,11 @@ function content_type_task_maestro_set_process_variable_logic(&$task, $current_v
   // Retrieve the tracking_id for the workflow instance
   // Use the tracking_id to get the Node id for the content record of type $content_type
   $tracking_id = maestro_getTaskTrackingId($task->_properties->id);
-  $query = db_select('maestro_project_content','content');
-  $query->addField('content','nid');
-  $query->condition('content.tracking_id',$tracking_id,'=');
-  $query->condition('content.instance',1,'=');
-  $query->condition('content.content_type',$content_type,'=');
+  $query = db_select('maestro_project_content', 'content');
+  $query->addField('content', 'nid');
+  $query->condition('content.tracking_id', $tracking_id, '=');
+  $query->condition('content.instance', 1, '=');
+  $query->condition('content.content_type', $content_type, '=');
   $nid = $query->execute()->fetchField();
   if (empty($nid)) {
     return FALSE;
@@ -1139,8 +1151,8 @@ function content_type_task_maestro_set_process_variable_logic(&$task, $current_v
    * Tried field_view_value but that returns a formatted array that may not even contain the value - could be a link for display
    */
   $field_data_column = key($field_info['columns']);
-  $node_entity = entity_load('node',array($nid));
-  $data = field_view_field('node',$node_entity[$nid],$field_name);
+  $node_entity = entity_load('node', array($nid));
+  $data = field_view_field('node', $node_entity[$nid], $field_name);
   $retval = $data['#items'][0][$field_data_column];
 
   return $retval;
@@ -1173,12 +1185,12 @@ function maestro_handle_taskconsole_ajax_request($action, $queue_id = 0) {
     case 'newprocess':
       $tid = intval($_POST['templateid']);
       $pid = maestro_launch_workflow($tid);
-      $retdata = array ('status' => "1", 'processid' => $pid);
+      $retdata = array('status' => "1", 'processid' => $pid);
       drupal_json_output($retdata);
       break;
 
     case 'setassignment':
-      $retdata = array ('status' => FALSE);
+      $retdata = array('status' => FALSE);
       if (user_access('maestro reassign tasks')) {
         $maestro = Maestro::createMaestroObject(1);
         $taskid = intval($_POST['taskid']);
@@ -1198,28 +1210,28 @@ function maestro_handle_taskconsole_ajax_request($action, $queue_id = 0) {
           switch ($_POST['assignment_type']) {
           case 'user':
             if ($assigned_value != $_POST['task_reassign_uid']) {
-              $maestro->engine()->reassignTask($taskid,$_POST['task_reassign_uid'],$_POST['taskuser'],$_POST['variable_id'],1);
+              $maestro->engine()->reassignTask($taskid, $_POST['task_reassign_uid'], $_POST['taskuser'], $_POST['variable_id'], 1);
               $username = db_query("SELECT name FROM {users} WHERE uid = :uid", array(':uid' => $_POST['task_reassign_uid']))->fetchField();
-            } else {
+            } 
+            else {
               $username = db_query("SELECT name FROM {users} WHERE uid = :uid", array(':uid' => $assigned_uid))->fetchField();
             }
-            $retdata = array ('status' => TRUE, 'username' => $username);
+            $retdata = array('status' => TRUE, 'username' => $username);
             break;
           case 'role':
             // Note in this case, the taskuser posted var is the group id unless it's been assigned by variable
-            $maestro->engine()->reassignTask($taskid,$_POST['task_reassign_uid'],$_POST['taskuser'],$_POST['variable_id'],2);
+            $maestro->engine()->reassignTask($taskid, $_POST['task_reassign_uid'], $_POST['taskuser'], $_POST['variable_id'], 2);
             $username = db_query("SELECT name FROM {users} WHERE uid = :uid", array(':uid' => $_POST['task_reassign_uid']))->fetchField();
-            $retdata = array ('status' => TRUE, 'username' => $username);
+            $retdata = array('status' => TRUE, 'username' => $username);
             break;
           case 'group':
             // Note in this case, the taskuser posted var is the group id unless it's been assigned by variable
-            $maestro->engine()->reassignTask($taskid,$_POST['task_reassign_uid'],$_POST['taskuser'],$_POST['variable_id'],3);
+            $maestro->engine()->reassignTask($taskid, $_POST['task_reassign_uid'], $_POST['taskuser'], $_POST['variable_id'], 3);
             $username = db_query("SELECT name FROM {users} WHERE uid = :uid", array(':uid' => $_POST['task_reassign_uid']))->fetchField();
-            $retdata = array ('status' => TRUE, 'username' => $username);
+            $retdata = array('status' => TRUE, 'username' => $username);
             break;
           }
         }
-
       }
       drupal_json_output($retdata);
       break;
@@ -1229,7 +1241,7 @@ function maestro_handle_taskconsole_ajax_request($action, $queue_id = 0) {
       $taskop = CHECK_PLAIN($_POST['op']);
       if ($queue_id > 0) {
         $rec = db_select('maestro_queue')
-        ->fields('maestro_queue', array('task_class_name','process_id'))
+        ->fields('maestro_queue', array('task_class_name', 'process_id'))
         ->condition('id', $queue_id, '=')
         ->execute()->fetchObject();
         $tasktype = $rec->task_class_name;
@@ -1238,20 +1250,23 @@ function maestro_handle_taskconsole_ajax_request($action, $queue_id = 0) {
         $data->process_id = $rec->process_id;
         $data->queue_id = $queue_id;
         $task = new $tasktype($data);
-        $ret = $task->processInteractiveTask($queue_id,$taskop);
+        $ret = $task->processInteractiveTask($queue_id, $taskop);
         if ($ret->retcode === TRUE) {
           if ($ret->engineop == 'completetask') {
             if (!isset($ret->status)) $ret->status = 1;    // Just in case interactive function has not set this - set to default 'success'
             $maestro = Maestro::createMaestroObject(1);    // Initiate the processing of all tasks of type 1.x
-            $maestro->engine()->completeTask($queue_id,$ret->status);
+            $maestro->engine()->completeTask($queue_id, $ret->status);
             $retdata = array('status' => TRUE, 'hidetask' => TRUE);
-          } else {
+          } 
+          else {
             $retdata = array('status' => TRUE, 'hidetask' => FALSE);
           }
-        } else{
+        } 
+        else{
           $retdata = array('status' => FALSE, 'hidetask' => FALSE);
         }
-      } else {
+      } 
+      else {
         $retdata = array('status' => FALSE, 'hidetask' => FALSE);
       }
       drupal_json_output($retdata);
@@ -1262,18 +1277,18 @@ function maestro_handle_taskconsole_ajax_request($action, $queue_id = 0) {
       $maestro = Maestro::createMaestroObject(1);    // Initiate the processing of all tasks of type 1.x
       $queue_id = intval($queue_id);
       $maestro->engine()->completeTask($queue_id);
-      $retdata = array ('status' => "1");
+      $retdata = array('status' => "1");
       drupal_json_output($retdata);
       break;
 
     case 'deleteproject':
       $tracking_id = intval($_POST['tracking_id']);
       $retval = maestro_delete_project($tracking_id);
-      if($retval) {
-        $retdata = array ('status' => "1", 'message' => t('Successful Deletion of Project'));
+      if ($retval) {
+        $retdata = array('status' => "1", 'message' => t('Successful Deletion of Project'));
       }
       else {
-        $retdata = array ('status' => "0", 'message' => t('You are not an admin.  Project not deleted.'));
+        $retdata = array('status' => "0", 'message' => t('You are not an admin.  Project not deleted.'));
       }
       drupal_json_output($retdata);
       break;
@@ -1281,7 +1296,7 @@ function maestro_handle_taskconsole_ajax_request($action, $queue_id = 0) {
     case 'add_comment':
       if (!empty($_POST['comment'])) {
         db_insert('maestro_project_comments')
-        ->fields(array('tracking_id','uid','task_id','timestamp','comment'))
+        ->fields(array('tracking_id', 'uid', 'task_id', 'timestamp', 'comment'))
         ->values(array(
                 'tracking_id' => $_POST['tracking_id'],
                 'uid' => $user->uid,
@@ -1291,32 +1306,35 @@ function maestro_handle_taskconsole_ajax_request($action, $queue_id = 0) {
         ))
         ->execute();
         $rowid = intval($_POST['rowid']);
-        $html = theme('maestro_project_comments',array('rowid' => $rowid, 'tracking_id' => $_POST['tracking_id']));
-        $retdata = array ('html' => $html,'status' => "1");
-      } else {
-        $retdata = array ('status' => "1");
+        $html = theme('maestro_project_comments', array('rowid' => $rowid, 'tracking_id' => $_POST['tracking_id']));
+        $retdata = array('html' => $html, 'status' => "1");
+      } 
+      else {
+        $retdata = array('status' => "1");
       }
       drupal_json_output($retdata);
       break;
 
     case 'del_comment':
       if ($_POST['cid'] > 0) {
-        $query = db_select('maestro_project_comments','a');
-        $query->addField('a','uid');
-        $query->condition('a.id',$_POST['cid'],'=');
+        $query = db_select('maestro_project_comments', 'a');
+        $query->addField('a', 'uid');
+        $query->condition('a.id', $_POST['cid'], '=');
         $comment_owner = $query->execute()->fetchField();
         if ($comment_owner == $user->uid OR user_access('maestro admin')) {
           db_delete('maestro_project_comments')
-            ->condition('id',$_POST['cid'],'=')
+            ->condition('id', $_POST['cid'], '=')
             ->execute();
           $rowid = intval($_POST['rowid']);
-          $html = theme('maestro_project_comments',array('rowid' => $rowid, 'tracking_id' => $_POST['tracking_id']));
-          $retdata = array ('html' => $html,'status' => "1");
-        } else {
-          $retdata = array ('status' => "0");
+          $html = theme('maestro_project_comments', array('rowid' => $rowid, 'tracking_id' => $_POST['tracking_id']));
+          $retdata = array('html' => $html, 'status' => "1");
+        } 
+        else {
+          $retdata = array('status' => "0");
         }
-      } else {
-        $retdata = array ('status' => "0");
+      } 
+      else {
+        $retdata = array('status' => "0");
       }
       drupal_json_output($retdata);
       break;
@@ -1328,33 +1346,33 @@ function maestro_handle_taskconsole_ajax_request($action, $queue_id = 0) {
         array(':id' => $task->tracking_id))->fetchField();
       $task->flow_name = $flowname;
       $rowid = intval($_POST['rowid']);
-      $html = theme('maestro_taskconsole_details',array('task' => $task, 'source' => 'mytasks', 'rowid' => $rowid ));
+      $html = theme('maestro_taskconsole_details', array('task' => $task, 'source' => 'mytasks', 'rowid' => $rowid ));
 
-      $retdata = array ('html' => $html,'status' => "1");
+      $retdata = array('html' => $html, 'status' => "1");
       drupal_json_output($retdata);
       break;
 
     case 'myflows':
-      $myflowfilter =  array('myflows' => true);
+      $myflowfilter =  array('myflows' => TRUE);
     case 'filterprojects':
       include('maestro.moderator.inc');
       $filter = array(
         'username' => check_plain($_POST['userNameFilter']),
         'projectname' => check_plain($_POST['flowNameFilter'])
         );
-      if(is_array($myflowfilter)) {  //this has to be an array.  otherwise, this is not a valid executable area for a non-regular user
+      if (is_array($myflowfilter)) {  //this has to be an array.  otherwise, this is not a valid executable area for a non-regular user
         $filter = array_merge($filter, $myflowfilter);
       }
       else {  //better check if the user should be here
-        if(!user_access('maestro admin')) {
-          $retdata = array ('html' => t('Illegal attempt on viewing flow data detected.'),'status' => "0");
+        if (!user_access('maestro admin')) {
+          $retdata = array('html' => t('Illegal attempt on viewing flow data detected.'), 'status' => "0");
           drupal_json_output($retdata);
           exit(0);
         }
       }
       $rows = maestro_get_all_flows_data($filter);
       $ajax_url = url('maestro/taskconsole/ajax');
-      $retdata = array ('html' => theme('maestro_all_flows_display', array('ajax_url' => $ajax_url, 'database_result_set' => $rows)),'status' => "1");
+      $retdata = array('html' => theme('maestro_all_flows_display', array('ajax_url' => $ajax_url, 'database_result_set' => $rows)), 'status' => "1");
       drupal_json_output($retdata);
       break;
 
@@ -1365,8 +1383,8 @@ function maestro_handle_taskconsole_ajax_request($action, $queue_id = 0) {
         array(':id' => $task->tracking_id))->fetchField();
       $task->flow_name = $flowname;
       $rowid = intval($_POST['projectID']);
-      $html = theme('maestro_taskconsole_details',array('task' => $task, 'source' => 'mytasks', 'rowid' => $rowid ));
-      $retdata = array ('html' => $html,'status' => "1");
+      $html = theme('maestro_taskconsole_details', array('task' => $task, 'source' => 'mytasks', 'rowid' => $rowid ));
+      $retdata = array('html' => $html, 'status' => "1");
       drupal_json_output($retdata);
       break;
   }
@@ -1381,15 +1399,15 @@ function maestro_handle_taskconsole_ajax_request($action, $queue_id = 0) {
 function maestro_form_alter(&$form, $form_state, $form_id) {
   /* Determine if the cached list of content types being used by configured maestro workflow templates is setup. */
   $maestro_content_types = cache_get('maestro_content_types');
-  if($maestro_content_types === FALSE) {  // if not set - scan templates for unique content types
+  if ($maestro_content_types === FALSE) {  // if not set - scan templates for unique content types
     $types = array();
-    $query = db_select('maestro_template_data','template_data');
-    $query->addField('template_data','task_data','task_data');
+    $query = db_select('maestro_template_data', 'template_data');
+    $query->addField('template_data', 'task_data', 'task_data');
     $query->condition('task_class_name', 'MaestroTaskTypeContentType', '=');
     $res = $query->execute();
     foreach ($res as $rec) {
       $data = unserialize($rec->task_data);
-      if (!empty($data['content_type']) AND !in_array($data['content_type'],$types)) {
+      if (!empty($data['content_type']) AND !in_array($data['content_type'], $types)) {
         $types[] = $data['content_type'] . '_node_form';
       }
     }
@@ -1400,19 +1418,19 @@ function maestro_form_alter(&$form, $form_state, $form_id) {
     $maestro_content_types = ($maestro_content_types->data);
   }
 
-  if (in_array($form_id,$maestro_content_types)) {
+  if (in_array($form_id, $maestro_content_types)) {
     $request = urldecode(request_uri());
-    $requestParms = explode('/',$request);
+    $requestParms = explode('/', $request);
 
     $maestroIndex=-1;
-    foreach($requestParms as $index => $val) {
-      if($val == 'maestro') {
+    foreach ($requestParms as $index => $val) {
+      if ($val == 'maestro') {
         $maestroIndex = $index;
         //removed the break, because we are looking for the last occurrance
         //of 'maestro' in the requestParms.
       }
     }
-    if($maestroIndex >= 2 ) { //really only applies if your site is named maestro, ie localhost/maestro, but a valid index should be around 5
+    if ($maestroIndex >= 2) { //really only applies if your site is named maestro, ie localhost/maestro, but a valid index should be around 5
       if (isset($requestParms[$maestroIndex]) AND $requestParms[$maestroIndex] == 'maestro' AND isset($requestParms[$maestroIndex + 1])) {
         if ($requestParms[$maestroIndex + 1] == 'edit' AND intval($requestParms[$maestroIndex + 2] > 0)) {
           $form['maestro_taskid'] = array(
@@ -1444,7 +1462,7 @@ function maestro_form_alter(&$form, $form_state, $form_id) {
         $form['actions']['submit']['#submit'][] = 'maestro_content_form_submit';
       }
     }
-    else if (array_key_exists('complete form', $form_state) && array_key_exists('maestro_taskid', $form_state['complete form'])) {
+    elseif (array_key_exists('complete form', $form_state) && array_key_exists('maestro_taskid', $form_state['complete form'])) {
       /** If there is a get/post action called, such as when an attachment field's upload button is clicked,
        * we need to re-add the fields to the form. so we check the form_state to see if the previous values
        * there so that we know it is a maestro content type task form we are dealing with.
@@ -1475,7 +1493,7 @@ function maestro_node_insert($node) {
     array(':tid' => $node->maestro_taskid))->fetchField();
 
     $task = new $task_classname();
-    $task->processContent($node->maestro_taskid,'insert',$node);
+    $task->processContent($node->maestro_taskid, 'insert', $node);
   }
 }
 
@@ -1521,7 +1539,7 @@ function maestro_content_form_submit($form, &$form_state) {
  * @return
  *   Node ID or FALSE
  */
-function maestro_getNodeId($process_id,$content_type) {
+function maestro_getNodeId($process_id, $content_type) {
   $tracking_id = db_select('maestro_process')
     ->fields('maestro_process', array('tracking_id'))
     ->condition('id', $process_id, '=')
@@ -1548,9 +1566,9 @@ function maestro_getNodeId($process_id,$content_type) {
  *   Tracking ID or FALSE
  */
 function maestro_getTaskTrackingId($taskid) {
-  $res = db_select('maestro_queue','a');
+  $res = db_select('maestro_queue', 'a');
   $res->join('maestro_process', 'b', 'a.process_id = b.id');
-  $res->fields('b',array('tracking_id'));
+  $res->fields('b', array('tracking_id'));
   $res->condition('a.id', $taskid, '=');
   $tracking_id = $res->execute()->fetchField();
   if ($tracking_id > 0 ) {
@@ -1569,27 +1587,27 @@ function maestro_getTaskTrackingId($taskid) {
  */
 function maestro_getProjectTasksHistory($tracking_id) {
 
-  $query = db_select('maestro_process','process');
+  $query = db_select('maestro_process', 'process');
   $query->join('maestro_queue', 'queue', 'queue.process_id = process.id');
   $query->join('maestro_template_data', 'template', 'queue.template_data_id = template.id');
   $query->join('users', 'users', 'users.uid = queue.uid');
-  $query->fields('queue', array('process_id','created_date','started_date','completed_date','status'));
-  $query->fields('template', array('taskname','is_dynamic_taskname','dynamic_taskname_variable_id'));
-  $query->addField('users','name','username');
-  $query->addField('users','uid');
-  $query->addField('queue','id','queue_id');
-  $query->addField('process','pid','parent_process_id');
+  $query->fields('queue', array('process_id', 'created_date', 'started_date', 'completed_date', 'status'));
+  $query->fields('template', array('taskname', 'is_dynamic_taskname', 'dynamic_taskname_variable_id'));
+  $query->addField('users', 'name', 'username');
+  $query->addField('users', 'uid');
+  $query->addField('queue', 'id', 'queue_id');
+  $query->addField('process', 'pid', 'parent_process_id');
   $query->condition('process.tracking_id', $tracking_id, '=');
-  $query->condition('queue.show_in_detail',1,'=');
-  $query->condition(db_or()->condition('queue.completed_date',0,'>')->condition('queue.status',MaestroTaskStatusCodes::STATUS_ON_HOLD,'='));
+  $query->condition('queue.show_in_detail', 1, '=');
+  $query->condition(db_or()->condition('queue.completed_date', 0, '>')->condition('queue.status', MaestroTaskStatusCodes::STATUS_ON_HOLD, '='));
   $res = $query->execute();
 
   $retval = array();
   foreach ($res as $record) {
     $ctask = new stdClass();
-    $ctask->assigned_date = strftime("%b %d/%Y %H:%M",$record->created_date);
-    $ctask->started_date = strftime("%b %d/%Y %H:%M",$record->started_date);
-    $ctask->completed_date = strftime("%b %d/%Y %H:%M",$record->completed_date);
+    $ctask->assigned_date = strftime("%b %d/%Y %H:%M", $record->created_date);
+    $ctask->started_date = strftime("%b %d/%Y %H:%M", $record->started_date);
+    $ctask->completed_date = strftime("%b %d/%Y %H:%M", $record->completed_date);
     $ctask->status = t('Completed');
     if ($record->uid == 0) $record->username = t('Maestro');
     if ($record->parent_process_id > 0) $record->taskname = '<span style="color:red;padding-right:3px;">[R]</span>' . $record->taskname;
@@ -1605,7 +1623,7 @@ function maestro_getProjectTasksHistory($tracking_id) {
  * Implementation of hook_maestro_notification_observer() found in the notifications class for Maestro
  */
 function maestro_maestro_notification_observer() {
-  return array('MaestroEmailNotification','SAMPLEMaestroTwitterNotification', 'MaestroWatchDogNotification'); //MaestroEmailNotification is the name of the class used for email notifications
+  return array('MaestroEmailNotification', 'SAMPLEMaestroTwitterNotification', 'MaestroWatchDogNotification'); //MaestroEmailNotification is the name of the class used for email notifications
 }
 
 /**
@@ -1646,7 +1664,7 @@ function maestro_mail($key, &$message, $params) {
  */
 function maestro_array_merge_keys($arr1, $arr2) {
   if (is_array($arr2)) {
-    foreach($arr2 as $k=>$v) {
+    foreach ($arr2 as $k => $v) {
       if (!array_key_exists($k, $arr1)) { //K DOESN'T EXISTS //
         $arr1[$k] = $v;
       }
@@ -1657,7 +1675,6 @@ function maestro_array_merge_keys($arr1, $arr2) {
       }
     }
   }
-
   return $arr1;
 }
 
@@ -1674,11 +1691,10 @@ function maestro_array_merge_keys($arr1, $arr2) {
  */
 function maestro_array_add($arr1, $arr2) {
   if (is_array($arr1) && is_array($arr2)) {
-    foreach ($arr2 as $k=>$v) {
+    foreach ($arr2 as $k => $v) {
       $arr1[] = $v;
     }
   }
-
   return $arr1;
 }
 
@@ -1690,8 +1706,8 @@ function maestro_array_add($arr1, $arr2) {
  * @param $new_flow_name
  *   String of text to which process description should be set
  */
-function maestro_set_process_flow_name ($process_id, $new_flow_name) {
-  if($process_id >0 && $new_flow_name != '') {
+function maestro_set_process_flow_name($process_id, $new_flow_name) {
+  if ($process_id >0 && $new_flow_name != '') {
     db_update('maestro_process')
             ->fields(array('flow_name' => $new_flow_name))
             ->condition('id', $process_id, '=')
@@ -1720,13 +1736,13 @@ function maestro_set_process_flow_name ($process_id, $new_flow_name) {
 function maestro_delete_project($tracking_id) {
   //first, we grab all of the processIDs that have a tracking ID that matches.
   $tracking_id = intval($tracking_id);
-  if(!user_access('maestro admin')) return false;
+  if (!user_access('maestro admin')) return FALSE;
 
   $query = db_select('maestro_process', 'a');
-  $query->fields('a',array('id'));
-  $query->condition('a.tracking_id',$tracking_id,'=');
+  $query->fields('a', array('id'));
+  $query->condition('a.tracking_id', $tracking_id, '=');
   $res = $query->execute()->fetchAll();
-  foreach($res as $rec) {
+  foreach ($res as $rec) {
     //now delete all process variables
     db_delete('maestro_process_variables')
         ->condition('process_id', $rec->id)
@@ -1734,10 +1750,10 @@ function maestro_delete_project($tracking_id) {
 
     //pick off all of the queue items now and use those to delete the queue_from entries
     $query = db_select('maestro_queue', 'a');
-    $query->fields('a',array('id'));
-    $query->condition('a.process_id',$rec->id,'=');
+    $query->fields('a', array('id'));
+    $query->condition('a.process_id', $rec->id, '=');
     $queueres = $query->execute()->fetchAll();
-    foreach($queueres as $queuerec) {
+    foreach ($queueres as $queuerec) {
       //delete the queue_from records now
       db_delete('maestro_queue_from')
         ->condition('queue_id', $queuerec->id)
@@ -1772,5 +1788,5 @@ function maestro_delete_project($tracking_id) {
       ->condition('id', $tracking_id)
       ->execute();
 
-  return true;
+  return TRUE;
 }
diff --git a/maestro.test b/maestro.test
index 31ce3da..511db14 100644
--- a/maestro.test
+++ b/maestro.test
@@ -34,10 +34,10 @@ class MaestroTestInstance extends DrupalWebTestCase {
   function testCreatingMaestroInstance() {
     include_once './' . drupal_get_path('module', 'maestro') . '/maestro.class.php';
     $this->drupalLogin($this->admin_user);
-    $v1=Maestro::createMaestroObject(1);
-    $v2=Maestro::createMaestroObject(1);
-    $exp=var_export($v1,true);
-    $exp2=var_export($v2,true);
+    $v1 = Maestro::createMaestroObject(1);
+    $v2 = Maestro::createMaestroObject(1);
+    $exp = var_export($v1, TRUE);
+    $exp2 = var_export($v2, TRUE);
     $this->assertTrue($exp == $exp2, t('Maestro Instantiation is a singleton'));
     $this->drupalLogout();
   }
@@ -45,7 +45,7 @@ class MaestroTestInstance extends DrupalWebTestCase {
 
   function testMaestroStructurePage() {
     $this->drupalGet('admin/structure/maestro');
-    $this->assertResponse(403,t('Non admin user should not be able to access the Maestro Structure menu.'));
+    $this->assertResponse(403, t('Non admin user should not be able to access the Maestro Structure menu.'));
     $this->drupalLogin($this->admin_user);
     $this->drupalGet('admin/structure/maestro');
     $this->assertResponse(200, t('Admin User can access the Maestro Structure Page.'));
@@ -56,51 +56,51 @@ class MaestroTestInstance extends DrupalWebTestCase {
     include_once './' . drupal_get_path('module', 'maestro') . '/maestro.admin.inc';
     $recID=0;
     $recID=maestro_createNewTemplate('test new template');
-    $this->assertTrue($recID == 2,t('First new template must have an ID of 2.'),'Maestro');
+    $this->assertTrue($recID == 2, t('First new template must have an ID of 2.'), 'Maestro');
   }
 
 
   function testCreateMaestroTemplateVariable() {
     include_once './' . drupal_get_path('module', 'maestro') . '/maestro.admin.inc';
     $query = db_select('maestro_template_variables', 'a');
-    $query->addExpression('count(a.id)','cnt');
-    $query->condition('a.template_id',1,'=');
+    $query->addExpression('count(a.id)', 'cnt');
+    $query->condition('a.template_id', 1, '=');
     $cnt=current($query->execute()->fetchAll());
     $this->varcount = $cnt->cnt;
-    $this->varID=maestro_createTemplateVariable(1,'test variable','5');
-    $this->assertTrue($this->varID > 0,t('New Variable must have an ID greater than 0. New ID:' . $this->varID),'Maestro');
+    $this->varID=maestro_createTemplateVariable(1, 'test variable', '5');
+    $this->assertTrue($this->varID > 0, t('New Variable must have an ID greater than 0. New ID:' . $this->varID), 'Maestro');
 
   }
 
-  function testDeleteMaestroTemplateVariable(){
+  function testDeleteMaestroTemplateVariable() {
     include_once './' . drupal_get_path('module', 'maestro') . '/maestro.admin.inc';
     maestro_deleteTemplateVariable($this->varID);
     $query = db_select('maestro_template_variables', 'a');
-    $query->addExpression('count(a.id)','cnt');
-    $query->condition('a.template_id',1,'=');
+    $query->addExpression('count(a.id)', 'cnt');
+    $query->condition('a.template_id', 1, '=');
     $cnt=current($query->execute()->fetchAll());
-    $this->assertTrue($cnt->cnt == $this->varcount,t('Deleting variable successful'),'Maestro');
+    $this->assertTrue($cnt->cnt == $this->varcount, t('Deleting variable successful'), 'Maestro');
   }
 
 
   function testCreateMaestroAppGroup() {
     include_once './' . drupal_get_path('module', 'maestro') . '/maestro.admin.inc';
     $query = db_select('maestro_app_groups', 'a');
-    $query->addExpression('count(a.id)','cnt');
+    $query->addExpression('count(a.id)', 'cnt');
     $cnt=current($query->execute()->fetchAll());
     $this->appGroupCount = $cnt->cnt;
     $this->appGroupID=maestro_createAppGroup('Test App Group');
-    $this->assertTrue($this->appGroupID > 0,t('New App Group must have an ID greater than 0. New ID:' . $this->appGroupID),'Maestro');
+    $this->assertTrue($this->appGroupID > 0, t('New App Group must have an ID greater than 0. New ID:' . $this->appGroupID), 'Maestro');
 
   }
 
-  function testDeleteMaestroAppGroup(){
+  function testDeleteMaestroAppGroup() {
     include_once './' . drupal_get_path('module', 'maestro') . '/maestro.admin.inc';
     maestro_deleteAppGroup($this->appGroupID);
     $query = db_select('maestro_app_groups', 'a');
-    $query->addExpression('count(a.id)','cnt');
+    $query->addExpression('count(a.id)', 'cnt');
     $cnt=current($query->execute()->fetchAll());
-    $this->assertTrue($cnt->cnt == $this->appGroupCount,t('Deleting App Group successful'),'Maestro');
+    $this->assertTrue($cnt->cnt == $this->appGroupCount, t('Deleting App Group successful'), 'Maestro');
   }
 
 }
diff --git a/maestro.views.inc b/maestro.views.inc
index e5012e7..8909271 100644
--- a/maestro.views.inc
+++ b/maestro.views.inc
@@ -1,7 +1,5 @@
 <?php
 
-// $Id:
-
 /**
  * @file
  * maestro.views.inc
@@ -10,7 +8,7 @@
 
 /**
  * Implementation of hook_views_api().
-*/
+ */
 function maestro_views_api() {
   return array(
     'api' => 2.0,
@@ -113,7 +111,7 @@ function maestro_views_data() {
     'real field' => 'id',
     'title' => t('Assigned Users'),
     'help' => t('All of the assigned users'),
-    'field' => array (
+    'field' => array(
       'handler' => 'views_handler_field_maestro_assigned_users',
       'click sortable' => TRUE,
     ),
@@ -122,17 +120,17 @@ function maestro_views_data() {
   $data['maestro_queue']['template_data_id'] = array(
     'title' => t('Template Data ID'),
     'help' => t('A Reference to the template data table.'),
-    'field' => array (
+    'field' => array(
       'handler' => 'views_handler_field_numeric',
       'click sortable' => TRUE,
     ),
   );
 
   //INT fields here:
-  $data['maestro_queue']['process_id'] = array (
+  $data['maestro_queue']['process_id'] = array(
     'title' => t('Process ID'),
     'help'  => t('Unique Process Identifier.'),
-    'field' => array (
+    'field' => array(
       'handler' => 'views_handler_field_numeric',
       'click sortable' => TRUE,
     ),
@@ -144,10 +142,10 @@ function maestro_views_data() {
     ),
   );
 
-  $data['maestro_queue']['engine_version'] = array (
+  $data['maestro_queue']['engine_version'] = array(
     'title' => t('Engine Version'),
     'help'  => t('Version of the engine used to run this task.'),
-    'field' => array (
+    'field' => array(
       'handler' => 'views_handler_field_numeric',
       'click sortable' => TRUE,
     ),
@@ -159,10 +157,10 @@ function maestro_views_data() {
     ),
   );
 
-  $data['maestro_queue']['is_interactive'] = array (
+  $data['maestro_queue']['is_interactive'] = array(
     'title' => t('Interactive Flag'),
     'help'  => t('Set to 1 for interactive. 0 for non-interactive.'),
-    'field' => array (
+    'field' => array(
       'handler' => 'views_handler_field_numeric',
       'click sortable' => TRUE,
     ),
@@ -174,10 +172,10 @@ function maestro_views_data() {
     ),
   );
 
-    $data['maestro_queue']['status'] = array (
+    $data['maestro_queue']['status'] = array(
     'title' => t('Status flag'),
     'help'  => t('Textual Status flag.'),
-    'field' => array (
+    'field' => array(
       'handler' => 'views_handler_field_maestro_status',  //using a custom field handler
       'click sortable' => TRUE,
     ),
@@ -189,10 +187,10 @@ function maestro_views_data() {
     ),
   );
 
-  $data['maestro_queue']['uid'] = array (
+  $data['maestro_queue']['uid'] = array(
     'title' => t('Completed By'),
     'help'  => t('The user who completed the task.'),
-    'field' => array (
+    'field' => array(
       'handler' => 'views_handler_field_maestro_uid',  //using a custom field handler
       'click sortable' => TRUE,
     ),
@@ -219,7 +217,7 @@ class views_handler_field_maestro_status extends views_handler_field_numeric {
 
   function render($values) {
     global $base_path;
-    @include_once($base_path . drupal_get_path('module','maestro') . '/maestro_contatnts.class.php');
+    @include_once($base_path . drupal_get_path('module', 'maestro') . '/maestro_contatnts.class.php');
     $value = $values->{$this->field_alias};
     return MaestroTaskStatusCodes::getStatusLabel($value);
   }
@@ -254,17 +252,17 @@ class views_handler_field_maestro_assigned_users extends views_handler_field_num
     //@TODO:  need to fix this method once the OG/role ability is rolled out
     $q = db_select('maestro_production_assignments', 'a');
     $q->join('users', 'b', 'a.assign_id = b.uid');
-    $q->addField('b','uid');
-    $q->addField('b','mail');
-    $q->addField('b','name');
-    $q->condition('a.task_id',intval($value));
+    $q->addField('b', 'uid');
+    $q->addField('b', 'mail');
+    $q->addField('b', 'name');
+    $q->condition('a.task_id', intval($value));
     $res = $q->execute();
     $output = "";
-    foreach($res as $record) {
-      if($output != '') $output .= "<br>";
+    foreach ($res as $record) {
+      if ($output != '') $output .= "<br>";
       $output .="{$record->name}";
     }
-    if($output == '') {
+    if ($output == '') {
       $output = t('Maestro');
     }
     return $output;
diff --git a/modules/maestro_technical_support_request_workflow/maestro_technical_support_request_workflow.features.inc b/modules/maestro_technical_support_request_workflow/maestro_technical_support_request_workflow.features.inc
index aaab00a..5ea7325 100644
--- a/modules/maestro_technical_support_request_workflow/maestro_technical_support_request_workflow.features.inc
+++ b/modules/maestro_technical_support_request_workflow/maestro_technical_support_request_workflow.features.inc
@@ -1,4 +1,8 @@
 <?php
+/**
+ * @file
+ */
+
 
 /**
  * Implementation of hook_node_info().
diff --git a/modules/maestro_technical_support_request_workflow/maestro_technical_support_request_workflow.install b/modules/maestro_technical_support_request_workflow/maestro_technical_support_request_workflow.install
index e61f8b4..e83fe88 100644
--- a/modules/maestro_technical_support_request_workflow/maestro_technical_support_request_workflow.install
+++ b/modules/maestro_technical_support_request_workflow/maestro_technical_support_request_workflow.install
@@ -1,5 +1,10 @@
 <?php
 
+/**
+ * @file
+ * maestro_technical_support_request_workflow.install
+ */
+
 function maestro_technical_support_request_workflow_uninstall() {
   db_update('node_type')
   ->fields(array('custom' => 1))
@@ -8,7 +13,7 @@ function maestro_technical_support_request_workflow_uninstall() {
 }
 
 function maestro_technical_support_request_workflow_install() {
-  include(drupal_get_path('module','maestro') . '/maestro.admin.inc');
+  include(drupal_get_path('module', 'maestro') . '/maestro.admin.inc');
 
   $_POST['offset_top'] = 0;
   $_POST['offset_left'] = 0;
@@ -16,10 +21,10 @@ function maestro_technical_support_request_workflow_install() {
   $variable_xref_array[0] = 0;
   $task_xref_array = Array();
   $task_xref_array[0] = 0;
-  $templateID = maestro_createNewTemplate("Technical Support Request", TRUE, TRUE, 700);
-  $variable_xref_array[1] = maestro_createTemplateVariable($templateID, "initiator", "");
-  $variable_xref_array[2] = maestro_createTemplateVariable($templateID, "assignee", "0");
-  $ti = new MaestroTaskInterfaceStart(0, $templateID);
+  $template_id = maestro_createNewTemplate("Technical Support Request", TRUE, TRUE, 700);
+  $variable_xref_array[1] = maestro_createTemplateVariable($template_id, "initiator", "");
+  $variable_xref_array[2] = maestro_createTemplateVariable($template_id, "assignee", "0");
+  $ti = new MaestroTaskInterfaceStart(0, $template_id);
   $ti->create();
   $task_xref_array[1] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -54,7 +59,7 @@ function maestro_technical_support_request_workflow_install() {
   $rec->offset_top = 31;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceEnd(0, $templateID);
+  $ti = new MaestroTaskInterfaceEnd(0, $template_id);
   $ti->create();
   $task_xref_array[2] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -89,7 +94,7 @@ function maestro_technical_support_request_workflow_install() {
   $rec->offset_top = 529;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceContentType(0, $templateID);
+  $ti = new MaestroTaskInterfaceContentType(0, $template_id);
   $ti->create();
   $task_xref_array[3] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -124,7 +129,7 @@ function maestro_technical_support_request_workflow_install() {
   $rec->offset_top = 147;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceSetProcessVariable(0, $templateID);
+  $ti = new MaestroTaskInterfaceSetProcessVariable(0, $template_id);
   $ti->create();
   $task_xref_array[4] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -159,7 +164,7 @@ function maestro_technical_support_request_workflow_install() {
   $rec->offset_top = 265;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceContentType(0, $templateID);
+  $ti = new MaestroTaskInterfaceContentType(0, $template_id);
   $ti->create();
   $task_xref_array[5] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -194,7 +199,7 @@ function maestro_technical_support_request_workflow_install() {
   $rec->offset_top = 148;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $templateID);
+  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $template_id);
   $ti->create();
   $task_xref_array[6] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -229,7 +234,7 @@ function maestro_technical_support_request_workflow_install() {
   $rec->offset_top = 301;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceIf(0, $templateID);
+  $ti = new MaestroTaskInterfaceIf(0, $template_id);
   $ti->create();
   $task_xref_array[7] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -264,7 +269,7 @@ function maestro_technical_support_request_workflow_install() {
   $rec->offset_top = 150;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceInlineFormAPI(0, $templateID);
+  $ti = new MaestroTaskInterfaceInlineFormAPI(0, $template_id);
   $ti->create();
   $task_xref_array[8] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -299,7 +304,7 @@ function maestro_technical_support_request_workflow_install() {
   $rec->offset_top = 305;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceBatchFunction(0, $templateID);
+  $ti = new MaestroTaskInterfaceBatchFunction(0, $template_id);
   $ti->create();
   $task_xref_array[9] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -334,7 +339,7 @@ function maestro_technical_support_request_workflow_install() {
   $rec->offset_top = 426;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceContentType(0, $templateID);
+  $ti = new MaestroTaskInterfaceContentType(0, $template_id);
   $ti->create();
   $task_xref_array[10] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -369,7 +374,7 @@ function maestro_technical_support_request_workflow_install() {
   $rec->offset_top = 24;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceIf(0, $templateID);
+  $ti = new MaestroTaskInterfaceIf(0, $template_id);
   $ti->create();
   $task_xref_array[11] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -409,41 +414,41 @@ function maestro_technical_support_request_workflow_install() {
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[3], 'b1' => $task_xref_array[4], 'c1' => $task_xref_array[0]));
   $query = db_select('maestro_template_data', 'a');
-  $query->fields('a',array('task_class_name'));
-  $query->condition('a.id',$task_xref_array[3],'=');
+  $query->fields('a', array('task_class_name'));
+  $query->condition('a.id', $task_xref_array[3], '=');
   $name=current($query->execute()->fetchAll());
   $task_type = substr($name->task_class_name, 15);
   $task_class = 'MaestroTaskInterface' . $task_type;
-  $ti = new $task_class(0,0);
+  $ti = new $task_class(0, 0);
   $modulated_id = $variable_xref_array[1];
   $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";
-  db_query($sql, array( 'a1' => $task_xref_array[3],'b1' => 1,'c1' => 2,'d1' => $modulated_id,));
+  db_query($sql, array('a1' => $task_xref_array[3], 'b1' => 1, 'c1' => 2, 'd1' => $modulated_id));
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[4], 'b1' => $task_xref_array[5], 'c1' => $task_xref_array[0]));
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[5], 'b1' => $task_xref_array[6], 'c1' => $task_xref_array[0]));
   $query = db_select('maestro_template_data', 'a');
-  $query->fields('a',array('task_class_name'));
-  $query->condition('a.id',$task_xref_array[5],'=');
+  $query->fields('a', array('task_class_name'));
+  $query->condition('a.id', $task_xref_array[5], '=');
   $name=current($query->execute()->fetchAll());
   $task_type = substr($name->task_class_name, 15);
   $task_class = 'MaestroTaskInterface' . $task_type;
-  $ti = new $task_class(0,0);
+  $ti = new $task_class(0, 0);
   $modulated_id = $variable_xref_array[2];
   $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";
-  db_query($sql, array( 'a1' => $task_xref_array[5],'b1' => 1,'c1' => 2,'d1' => $modulated_id,));
+  db_query($sql, array('a1' => $task_xref_array[5], 'b1' => 1, 'c1' => 2, 'd1' => $modulated_id));
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[6], 'b1' => $task_xref_array[7], 'c1' => $task_xref_array[0]));
   $query = db_select('maestro_template_data', 'a');
-  $query->fields('a',array('task_class_name'));
-  $query->condition('a.id',$task_xref_array[6],'=');
+  $query->fields('a', array('task_class_name'));
+  $query->condition('a.id', $task_xref_array[6], '=');
   $name=current($query->execute()->fetchAll());
   $task_type = substr($name->task_class_name, 15);
   $task_class = 'MaestroTaskInterface' . $task_type;
-  $ti = new $task_class(0,0);
+  $ti = new $task_class(0, 0);
   $modulated_id = $variable_xref_array[1];
   $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";
-  db_query($sql, array( 'a1' => $task_xref_array[6],'b1' => 1,'c1' => 2,'d1' => $modulated_id,));
+  db_query($sql, array('a1' => $task_xref_array[6], 'b1' => 1, 'c1' => 2, 'd1' => $modulated_id));
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[7], 'b1' => $task_xref_array[8], 'c1' => $task_xref_array[0]));
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
@@ -451,29 +456,29 @@ function maestro_technical_support_request_workflow_install() {
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[8], 'b1' => $task_xref_array[9], 'c1' => $task_xref_array[0]));
   $query = db_select('maestro_template_data', 'a');
-  $query->fields('a',array('task_class_name'));
-  $query->condition('a.id',$task_xref_array[8],'=');
+  $query->fields('a', array('task_class_name'));
+  $query->condition('a.id', $task_xref_array[8], '=');
   $name=current($query->execute()->fetchAll());
   $task_type = substr($name->task_class_name, 15);
   $task_class = 'MaestroTaskInterface' . $task_type;
-  $ti = new $task_class(0,0);
+  $ti = new $task_class(0, 0);
   $modulated_id = $variable_xref_array[2];
   $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";
-  db_query($sql, array( 'a1' => $task_xref_array[8],'b1' => 1,'c1' => 2,'d1' => $modulated_id,));
+  db_query($sql, array('a1' => $task_xref_array[8], 'b1' => 1, 'c1' => 2, 'd1' => $modulated_id));
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[9], 'b1' => $task_xref_array[2], 'c1' => $task_xref_array[0]));
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[10], 'b1' => $task_xref_array[11], 'c1' => $task_xref_array[0]));
   $query = db_select('maestro_template_data', 'a');
-  $query->fields('a',array('task_class_name'));
-  $query->condition('a.id',$task_xref_array[10],'=');
+  $query->fields('a', array('task_class_name'));
+  $query->condition('a.id', $task_xref_array[10], '=');
   $name=current($query->execute()->fetchAll());
   $task_type = substr($name->task_class_name, 15);
   $task_class = 'MaestroTaskInterface' . $task_type;
-  $ti = new $task_class(0,0);
+  $ti = new $task_class(0, 0);
   $modulated_id = $variable_xref_array[1];
   $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";
-  db_query($sql, array( 'a1' => $task_xref_array[10],'b1' => 1,'c1' => 2,'d1' => $modulated_id,));
+  db_query($sql, array('a1' => $task_xref_array[10], 'b1' => 1, 'c1' => 2, 'd1' => $modulated_id));
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[11], 'b1' => $task_xref_array[0], 'c1' => $task_xref_array[3]));
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
diff --git a/modules/maestro_test_flows/maestro_test_flows.install b/modules/maestro_test_flows/maestro_test_flows.install
index b4dc5a9..689fe76 100644
--- a/modules/maestro_test_flows/maestro_test_flows.install
+++ b/modules/maestro_test_flows/maestro_test_flows.install
@@ -1,5 +1,4 @@
 <?php
-// $Id:
 
 /**
  * @file
@@ -7,22 +6,22 @@
  */
 
 function maestro_test_flows_install() {
-  include(drupal_get_path('module','maestro') . '/maestro.admin.inc');
+  include(drupal_get_path('module', 'maestro') . '/maestro.admin.inc');
 
   $dt = date("m-d-Y", time());
   $app_group_id = maestro_createAppGroup("Sample Workflow AppGroup created " . $dt);
 
-	/* Basic Test Workflow Example */
+  /* Basic Test Workflow Example */
   $_POST['offset_top'] = 0;
   $_POST['offset_left'] = 0;
   $variable_xref_array = Array();
   $variable_xref_array[0] = 0;
   $task_xref_array = Array();
   $task_xref_array[0] = 0;
-  $templateID = maestro_createNewTemplate("Test - Basic Workflow Example", TRUE, TRUE, 500);
-  $variable_xref_array[1] = maestro_createTemplateVariable($templateID, "initiator", "");
-  $variable_xref_array[2] = maestro_createTemplateVariable($templateID, "var1", "0");
-  $ti = new MaestroTaskInterfaceStart(0, $templateID);
+  $template_id = maestro_createNewTemplate("Test - Basic Workflow Example", TRUE, TRUE, 500);
+  $variable_xref_array[1] = maestro_createTemplateVariable($template_id, "initiator", "");
+  $variable_xref_array[2] = maestro_createTemplateVariable($template_id, "var1", "0");
+  $ti = new MaestroTaskInterfaceStart(0, $template_id);
   $ti->create();
   $task_xref_array[1] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -57,7 +56,7 @@ function maestro_test_flows_install() {
   $rec->offset_top = 100;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceEnd(0, $templateID);
+  $ti = new MaestroTaskInterfaceEnd(0, $template_id);
   $ti->create();
   $task_xref_array[2] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -92,7 +91,7 @@ function maestro_test_flows_install() {
   $rec->offset_top = 308;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceSetProcessVariable(0, $templateID);
+  $ti = new MaestroTaskInterfaceSetProcessVariable(0, $template_id);
   $ti->create();
   $task_xref_array[3] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -127,7 +126,7 @@ function maestro_test_flows_install() {
   $rec->offset_top = 100;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceIf(0, $templateID);
+  $ti = new MaestroTaskInterfaceIf(0, $template_id);
   $ti->create();
   $task_xref_array[4] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -162,7 +161,7 @@ function maestro_test_flows_install() {
   $rec->offset_top = 200;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $templateID);
+  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $template_id);
   $ti->create();
   $task_xref_array[5] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -197,7 +196,7 @@ function maestro_test_flows_install() {
   $rec->offset_top = 299;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $templateID);
+  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $template_id);
   $ti->create();
   $task_xref_array[6] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -243,27 +242,27 @@ function maestro_test_flows_install() {
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[5], 'b1' => $task_xref_array[2], 'c1' => $task_xref_array[0]));
   $query = db_select('maestro_template_data', 'a');
-  $query->fields('a',array('task_class_name'));
-  $query->condition('a.id',$task_xref_array[5],'=');
+  $query->fields('a', array('task_class_name'));
+  $query->condition('a.id', $task_xref_array[5], '=');
   $name=current($query->execute()->fetchAll());
   $task_type = substr($name->task_class_name, 15);
   $task_class = 'MaestroTaskInterface' . $task_type;
-  $ti = new $task_class(0,0);
+  $ti = new $task_class(0, 0);
   $modulated_id = $variable_xref_array[1];
   $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";
-  db_query($sql, array( 'a1' => $task_xref_array[5],'b1' => 1,'c1' => 2,'d1' => $modulated_id,));
+  db_query($sql, array('a1' => $task_xref_array[5], 'b1' => 1, 'c1' => 2, 'd1' => $modulated_id));
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[6], 'b1' => $task_xref_array[2], 'c1' => $task_xref_array[0]));
   $query = db_select('maestro_template_data', 'a');
-  $query->fields('a',array('task_class_name'));
-  $query->condition('a.id',$task_xref_array[6],'=');
+  $query->fields('a', array('task_class_name'));
+  $query->condition('a.id', $task_xref_array[6], '=');
   $name=current($query->execute()->fetchAll());
   $task_type = substr($name->task_class_name, 15);
   $task_class = 'MaestroTaskInterface' . $task_type;
-  $ti = new $task_class(0,0);
+  $ti = new $task_class(0, 0);
   $modulated_id = $variable_xref_array[1];
   $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";
-  db_query($sql, array( 'a1' => $task_xref_array[6],'b1' => 1,'c1' => 2,'d1' => $modulated_id,));
+  db_query($sql, array('a1' => $task_xref_array[6], 'b1' => 1, 'c1' => 2, 'd1' => $modulated_id));
 
 
   /* Parallel Workflow Test */
@@ -273,10 +272,10 @@ function maestro_test_flows_install() {
   $variable_xref_array[0] = 0;
   $task_xref_array = Array();
   $task_xref_array[0] = 0;
-  $templateID = maestro_createNewTemplate("Test Simple Parallel AND", TRUE, TRUE, 500);
-  maestro_joinAppGroup($templateID, $app_group_id);
-  $variable_xref_array[10] = maestro_createTemplateVariable($templateID, "initiator", "");
-  $ti = new MaestroTaskInterfaceStart(0, $templateID);
+  $template_id = maestro_createNewTemplate("Test Simple Parallel AND", TRUE, TRUE, 500);
+  maestro_joinAppGroup($template_id, $app_group_id);
+  $variable_xref_array[10] = maestro_createTemplateVariable($template_id, "initiator", "");
+  $ti = new MaestroTaskInterfaceStart(0, $template_id);
   $ti->create();
   $task_xref_array[28] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -310,7 +309,7 @@ function maestro_test_flows_install() {
   $rec->offset_top = 249;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceEnd(0, $templateID);
+  $ti = new MaestroTaskInterfaceEnd(0, $template_id);
   $ti->create();
   $task_xref_array[29] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -344,7 +343,7 @@ function maestro_test_flows_install() {
   $rec->offset_top = 250;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $templateID);
+  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $template_id);
   $ti->create();
   $task_xref_array[30] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -378,7 +377,7 @@ function maestro_test_flows_install() {
   $rec->offset_top = 368;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $templateID);
+  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $template_id);
   $ti->create();
   $task_xref_array[31] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -412,7 +411,7 @@ function maestro_test_flows_install() {
   $rec->offset_top = 236;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $templateID);
+  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $template_id);
   $ti->create();
   $task_xref_array[32] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -446,7 +445,7 @@ function maestro_test_flows_install() {
   $rec->offset_top = 114;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceAnd(0, $templateID);
+  $ti = new MaestroTaskInterfaceAnd(0, $template_id);
   $ti->create();
   $task_xref_array[33] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -489,39 +488,39 @@ function maestro_test_flows_install() {
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[30], 'b1' => $task_xref_array[33], 'c1' => $task_xref_array[0]));
   $query = db_select('maestro_template_data', 'a');
-  $query->fields('a',array('task_class_name'));
-  $query->condition('a.id',$task_xref_array[30],'=');
+  $query->fields('a', array('task_class_name'));
+  $query->condition('a.id', $task_xref_array[30], '=');
   $name=current($query->execute()->fetchAll());
   $task_type = substr($name->task_class_name, 15);
   $task_class = 'MaestroTaskInterface' . $task_type;
-  $ti = new $task_class(0,0);
+  $ti = new $task_class(0, 0);
   $modulated_id = $variable_xref_array[10];
   $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";
-  db_query($sql, array( 'a1' => $task_xref_array[30],'b1' => 1,'c1' => 2,'d1' => $modulated_id,));
+  db_query($sql, array('a1' => $task_xref_array[30], 'b1' => 1, 'c1' => 2, 'd1' => $modulated_id));
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[31], 'b1' => $task_xref_array[33], 'c1' => $task_xref_array[0]));
   $query = db_select('maestro_template_data', 'a');
-  $query->fields('a',array('task_class_name'));
-  $query->condition('a.id',$task_xref_array[31],'=');
+  $query->fields('a', array('task_class_name'));
+  $query->condition('a.id', $task_xref_array[31], '=');
   $name=current($query->execute()->fetchAll());
   $task_type = substr($name->task_class_name, 15);
   $task_class = 'MaestroTaskInterface' . $task_type;
-  $ti = new $task_class(0,0);
+  $ti = new $task_class(0, 0);
   $modulated_id = $variable_xref_array[10];
   $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";
-  db_query($sql, array( 'a1' => $task_xref_array[31],'b1' => 1,'c1' => 2,'d1' => $modulated_id,));
+  db_query($sql, array('a1' => $task_xref_array[31], 'b1' => 1, 'c1' => 2, 'd1' => $modulated_id));
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[32], 'b1' => $task_xref_array[33], 'c1' => $task_xref_array[0]));
   $query = db_select('maestro_template_data', 'a');
-  $query->fields('a',array('task_class_name'));
-  $query->condition('a.id',$task_xref_array[32],'=');
+  $query->fields('a', array('task_class_name'));
+  $query->condition('a.id', $task_xref_array[32], '=');
   $name=current($query->execute()->fetchAll());
   $task_type = substr($name->task_class_name, 15);
   $task_class = 'MaestroTaskInterface' . $task_type;
-  $ti = new $task_class(0,0);
+  $ti = new $task_class(0, 0);
   $modulated_id = $variable_xref_array[10];
   $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";
-  db_query($sql, array( 'a1' => $task_xref_array[32],'b1' => 1,'c1' => 2,'d1' => $modulated_id,));
+  db_query($sql, array('a1' => $task_xref_array[32], 'b1' => 1, 'c1' => 2, 'd1' => $modulated_id));
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[33], 'b1' => $task_xref_array[29], 'c1' => $task_xref_array[0]));
 
@@ -533,10 +532,10 @@ function maestro_test_flows_install() {
   $variable_xref_array[0] = 0;
   $task_xref_array = Array();
   $task_xref_array[0] = 0;
-  $templateID = maestro_createNewTemplate("Test Parallel and Sequential Branches", TRUE, TRUE, 600);
-  maestro_joinAppGroup($templateID, $app_group_id);
-  $variable_xref_array[11] = maestro_createTemplateVariable($templateID, "initiator", "");
-  $ti = new MaestroTaskInterfaceStart(0, $templateID);
+  $template_id = maestro_createNewTemplate("Test Parallel and Sequential Branches", TRUE, TRUE, 600);
+  maestro_joinAppGroup($template_id, $app_group_id);
+  $variable_xref_array[11] = maestro_createTemplateVariable($template_id, "initiator", "");
+  $ti = new MaestroTaskInterfaceStart(0, $template_id);
   $ti->create();
   $task_xref_array[34] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -570,7 +569,7 @@ function maestro_test_flows_install() {
   $rec->offset_top = 86;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceEnd(0, $templateID);
+  $ti = new MaestroTaskInterfaceEnd(0, $template_id);
   $ti->create();
   $task_xref_array[35] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -604,7 +603,7 @@ function maestro_test_flows_install() {
   $rec->offset_top = 594;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $templateID);
+  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $template_id);
   $ti->create();
   $task_xref_array[36] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -638,7 +637,7 @@ function maestro_test_flows_install() {
   $rec->offset_top = 181;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $templateID);
+  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $template_id);
   $ti->create();
   $task_xref_array[37] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -672,7 +671,7 @@ function maestro_test_flows_install() {
   $rec->offset_top = 290;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $templateID);
+  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $template_id);
   $ti->create();
   $task_xref_array[38] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -706,7 +705,7 @@ function maestro_test_flows_install() {
   $rec->offset_top = 187;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $templateID);
+  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $template_id);
   $ti->create();
   $task_xref_array[39] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -740,7 +739,7 @@ function maestro_test_flows_install() {
   $rec->offset_top = 295;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $templateID);
+  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $template_id);
   $ti->create();
   $task_xref_array[40] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -774,7 +773,7 @@ function maestro_test_flows_install() {
   $rec->offset_top = 294;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceAnd(0, $templateID);
+  $ti = new MaestroTaskInterfaceAnd(0, $template_id);
   $ti->create();
   $task_xref_array[41] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -808,7 +807,7 @@ function maestro_test_flows_install() {
   $rec->offset_top = 413;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceAnd(0, $templateID);
+  $ti = new MaestroTaskInterfaceAnd(0, $template_id);
   $ti->create();
   $task_xref_array[42] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -849,65 +848,65 @@ function maestro_test_flows_install() {
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[36], 'b1' => $task_xref_array[37], 'c1' => $task_xref_array[0]));
   $query = db_select('maestro_template_data', 'a');
-  $query->fields('a',array('task_class_name'));
-  $query->condition('a.id',$task_xref_array[36],'=');
+  $query->fields('a', array('task_class_name'));
+  $query->condition('a.id', $task_xref_array[36], '=');
   $name=current($query->execute()->fetchAll());
   $task_type = substr($name->task_class_name, 15);
   $task_class = 'MaestroTaskInterface' . $task_type;
-  $ti = new $task_class(0,0);
+  $ti = new $task_class(0, 0);
   $modulated_id = $variable_xref_array[11];
   $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";
-  db_query($sql, array( 'a1' => $task_xref_array[36],'b1' => 1,'c1' => 2,'d1' => $modulated_id,));
+  db_query($sql, array('a1' => $task_xref_array[36], 'b1' => 1, 'c1' => 2, 'd1' => $modulated_id));
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[37], 'b1' => $task_xref_array[42], 'c1' => $task_xref_array[0]));
   $query = db_select('maestro_template_data', 'a');
-  $query->fields('a',array('task_class_name'));
-  $query->condition('a.id',$task_xref_array[37],'=');
+  $query->fields('a', array('task_class_name'));
+  $query->condition('a.id', $task_xref_array[37], '=');
   $name=current($query->execute()->fetchAll());
   $task_type = substr($name->task_class_name, 15);
   $task_class = 'MaestroTaskInterface' . $task_type;
-  $ti = new $task_class(0,0);
+  $ti = new $task_class(0, 0);
   $modulated_id = $variable_xref_array[11];
   $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";
-  db_query($sql, array( 'a1' => $task_xref_array[37],'b1' => 1,'c1' => 2,'d1' => $modulated_id,));
+  db_query($sql, array( 'a1' => $task_xref_array[37], 'b1' => 1, 'c1' => 2, 'd1' => $modulated_id));
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[38], 'b1' => $task_xref_array[39], 'c1' => $task_xref_array[0]));
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[38], 'b1' => $task_xref_array[40], 'c1' => $task_xref_array[0]));
   $query = db_select('maestro_template_data', 'a');
-  $query->fields('a',array('task_class_name'));
-  $query->condition('a.id',$task_xref_array[38],'=');
+  $query->fields('a', array('task_class_name'));
+  $query->condition('a.id', $task_xref_array[38], '=');
   $name=current($query->execute()->fetchAll());
   $task_type = substr($name->task_class_name, 15);
   $task_class = 'MaestroTaskInterface' . $task_type;
-  $ti = new $task_class(0,0);
+  $ti = new $task_class(0, 0);
   $modulated_id = $variable_xref_array[11];
   $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";
-  db_query($sql, array( 'a1' => $task_xref_array[38],'b1' => 1,'c1' => 2,'d1' => $modulated_id,));
+  db_query($sql, array('a1' => $task_xref_array[38], 'b1' => 1, 'c1' => 2, 'd1' => $modulated_id));
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[39], 'b1' => $task_xref_array[41], 'c1' => $task_xref_array[0]));
   $query = db_select('maestro_template_data', 'a');
-  $query->fields('a',array('task_class_name'));
-  $query->condition('a.id',$task_xref_array[39],'=');
+  $query->fields('a', array('task_class_name'));
+  $query->condition('a.id', $task_xref_array[39], '=');
   $name=current($query->execute()->fetchAll());
   $task_type = substr($name->task_class_name, 15);
   $task_class = 'MaestroTaskInterface' . $task_type;
-  $ti = new $task_class(0,0);
+  $ti = new $task_class(0, 0);
   $modulated_id = $variable_xref_array[11];
   $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";
-  db_query($sql, array( 'a1' => $task_xref_array[39],'b1' => 1,'c1' => 2,'d1' => $modulated_id,));
+  db_query($sql, array('a1' => $task_xref_array[39], 'b1' => 1, 'c1' => 2, 'd1' => $modulated_id));
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[40], 'b1' => $task_xref_array[41], 'c1' => $task_xref_array[0]));
   $query = db_select('maestro_template_data', 'a');
-  $query->fields('a',array('task_class_name'));
-  $query->condition('a.id',$task_xref_array[40],'=');
+  $query->fields('a', array('task_class_name'));
+  $query->condition('a.id', $task_xref_array[40], '=');
   $name=current($query->execute()->fetchAll());
   $task_type = substr($name->task_class_name, 15);
   $task_class = 'MaestroTaskInterface' . $task_type;
-  $ti = new $task_class(0,0);
+  $ti = new $task_class(0, 0);
   $modulated_id = $variable_xref_array[11];
   $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";
-  db_query($sql, array( 'a1' => $task_xref_array[40],'b1' => 1,'c1' => 2,'d1' => $modulated_id,));
+  db_query($sql, array('a1' => $task_xref_array[40], 'b1' => 1, 'c1' => 2, 'd1' => $modulated_id));
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[41], 'b1' => $task_xref_array[42], 'c1' => $task_xref_array[0]));
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
@@ -920,10 +919,10 @@ $variable_xref_array = Array();
 $variable_xref_array[0] = 0;
 $task_xref_array = Array();
 $task_xref_array[0] = 0;
-$templateID = maestro_createNewTemplate("Test Content Type Task - with regen", TRUE, TRUE, 500);
-$variable_xref_array[5] = maestro_createTemplateVariable($templateID, "initiator", "");
-$variable_xref_array[6] = maestro_createTemplateVariable($templateID, "content_type", "article");
-$ti = new MaestroTaskInterfaceStart(0, $templateID);
+$template_id = maestro_createNewTemplate("Test Content Type Task - with regen", TRUE, TRUE, 500);
+$variable_xref_array[5] = maestro_createTemplateVariable($template_id, "initiator", "");
+$variable_xref_array[6] = maestro_createTemplateVariable($template_id, "content_type", "article");
+$ti = new MaestroTaskInterfaceStart(0, $template_id);
 $ti->create();
 $task_xref_array[22] = $ti->get_task_id();
 $res = db_select('maestro_template_data', 'a');
@@ -958,7 +957,7 @@ $rec->offset_left = 46;
 $rec->offset_top = 111;
 $rec->surpress_first_notification = 0;
 drupal_write_record('maestro_template_data', $rec, array('id'));
-$ti = new MaestroTaskInterfaceEnd(0, $templateID);
+$ti = new MaestroTaskInterfaceEnd(0, $template_id);
 $ti->create();
 $task_xref_array[23] = $ti->get_task_id();
 $res = db_select('maestro_template_data', 'a');
@@ -993,7 +992,7 @@ $rec->offset_left = 652;
 $rec->offset_top = 496;
 $rec->surpress_first_notification = 0;
 drupal_write_record('maestro_template_data', $rec, array('id'));
-$ti = new MaestroTaskInterfaceContentType(0, $templateID);
+$ti = new MaestroTaskInterfaceContentType(0, $template_id);
 $ti->create();
 $task_xref_array[24] = $ti->get_task_id();
 $res = db_select('maestro_template_data', 'a');
@@ -1028,7 +1027,7 @@ $rec->offset_left = 243;
 $rec->offset_top = 100;
 $rec->surpress_first_notification = 0;
 drupal_write_record('maestro_template_data', $rec, array('id'));
-$ti = new MaestroTaskInterfaceInteractiveFunction(0, $templateID);
+$ti = new MaestroTaskInterfaceInteractiveFunction(0, $template_id);
 $ti->create();
 $task_xref_array[25] = $ti->get_task_id();
 $res = db_select('maestro_template_data', 'a');
@@ -1063,7 +1062,7 @@ $rec->offset_left = 480;
 $rec->offset_top = 99;
 $rec->surpress_first_notification = 0;
 drupal_write_record('maestro_template_data', $rec, array('id'));
-$ti = new MaestroTaskInterfaceIf(0, $templateID);
+$ti = new MaestroTaskInterfaceIf(0, $template_id);
 $ti->create();
 $task_xref_array[26] = $ti->get_task_id();
 $res = db_select('maestro_template_data', 'a');
@@ -1098,7 +1097,7 @@ $rec->offset_left = 327;
 $rec->offset_top = 255;
 $rec->surpress_first_notification = 0;
 drupal_write_record('maestro_template_data', $rec, array('id'));
-$ti = new MaestroTaskInterfaceInteractiveFunction(0, $templateID);
+$ti = new MaestroTaskInterfaceInteractiveFunction(0, $template_id);
 $ti->create();
 $task_xref_array[27] = $ti->get_task_id();
 $res = db_select('maestro_template_data', 'a');
@@ -1133,7 +1132,7 @@ $rec->offset_left = 339;
 $rec->offset_top = 368;
 $rec->surpress_first_notification = 0;
 drupal_write_record('maestro_template_data', $rec, array('id'));
-$ti = new MaestroTaskInterfaceIf(0, $templateID);
+$ti = new MaestroTaskInterfaceIf(0, $template_id);
 $ti->create();
 $task_xref_array[28] = $ti->get_task_id();
 $res = db_select('maestro_template_data', 'a');
@@ -1168,7 +1167,7 @@ $rec->offset_left = 606;
 $rec->offset_top = 301;
 $rec->surpress_first_notification = 0;
 drupal_write_record('maestro_template_data', $rec, array('id'));
-$ti = new MaestroTaskInterfaceBatchFunction(0, $templateID);
+$ti = new MaestroTaskInterfaceBatchFunction(0, $template_id);
 $ti->create();
 $task_xref_array[29] = $ti->get_task_id();
 $res = db_select('maestro_template_data', 'a');
@@ -1208,27 +1207,27 @@ db_query($sql, array('a1' => $task_xref_array[22], 'b1' => $task_xref_array[24],
 $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
 db_query($sql, array('a1' => $task_xref_array[24], 'b1' => $task_xref_array[25], 'c1' => $task_xref_array[0]));
 $query = db_select('maestro_template_data', 'a');
-$query->fields('a',array('task_class_name'));
-$query->condition('a.id',$task_xref_array[24],'=');
+$query->fields('a', array('task_class_name'));
+$query->condition('a.id', $task_xref_array[24], '=');
 $name=current($query->execute()->fetchAll());
 $task_type = substr($name->task_class_name, 15);
 $task_class = 'MaestroTaskInterface' . $task_type;
-$ti = new $task_class(0,0);
+$ti = new $task_class(0, 0);
 $modulated_id = $variable_xref_array[5];
 $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";
-db_query($sql, array( 'a1' => $task_xref_array[24],'b1' => 1,'c1' => 2,'d1' => $modulated_id,));
+db_query($sql, array('a1' => $task_xref_array[24], 'b1' => 1, 'c1' => 2, 'd1' => $modulated_id));
 $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
 db_query($sql, array('a1' => $task_xref_array[25], 'b1' => $task_xref_array[26], 'c1' => $task_xref_array[0]));
 $query = db_select('maestro_template_data', 'a');
-$query->fields('a',array('task_class_name'));
-$query->condition('a.id',$task_xref_array[25],'=');
+$query->fields('a', array('task_class_name'));
+$query->condition('a.id', $task_xref_array[25], '=');
 $name=current($query->execute()->fetchAll());
 $task_type = substr($name->task_class_name, 15);
 $task_class = 'MaestroTaskInterface' . $task_type;
-$ti = new $task_class(0,0);
+$ti = new $task_class(0, 0);
 $modulated_id = $variable_xref_array[5];
 $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";
-db_query($sql, array( 'a1' => $task_xref_array[25],'b1' => 1,'c1' => 2,'d1' => $modulated_id,));
+db_query($sql, array( 'a1' => $task_xref_array[25], 'b1' => 1, 'c1' => 2, 'd1' => $modulated_id));
 $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
 db_query($sql, array('a1' => $task_xref_array[26], 'b1' => $task_xref_array[0], 'c1' => $task_xref_array[24]));
 $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
@@ -1236,15 +1235,15 @@ db_query($sql, array('a1' => $task_xref_array[26], 'b1' => $task_xref_array[27],
 $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
 db_query($sql, array('a1' => $task_xref_array[27], 'b1' => $task_xref_array[28], 'c1' => $task_xref_array[0]));
 $query = db_select('maestro_template_data', 'a');
-$query->fields('a',array('task_class_name'));
-$query->condition('a.id',$task_xref_array[27],'=');
+$query->fields('a', array('task_class_name'));
+$query->condition('a.id', $task_xref_array[27], '=');
 $name=current($query->execute()->fetchAll());
 $task_type = substr($name->task_class_name, 15);
 $task_class = 'MaestroTaskInterface' . $task_type;
-$ti = new $task_class(0,0);
+$ti = new $task_class(0, 0);
 $modulated_id = $variable_xref_array[5];
 $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";
-db_query($sql, array( 'a1' => $task_xref_array[27],'b1' => 1,'c1' => 2,'d1' => $modulated_id,));
+db_query($sql, array( 'a1' => $task_xref_array[27], 'b1' => 1, 'c1' => 2, 'd1' => $modulated_id));
 $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
 db_query($sql, array('a1' => $task_xref_array[28], 'b1' => $task_xref_array[0], 'c1' => $task_xref_array[25]));
 $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
@@ -1262,10 +1261,10 @@ db_query($sql, array('a1' => $task_xref_array[29], 'b1' => $task_xref_array[23],
   $variable_xref_array[0] = 0;
   $task_xref_array = Array();
   $task_xref_array[0] = 0;
-  $templateID = maestro_createNewTemplate("Test - Basic Batch Task Example", TRUE, TRUE, 500);
-  maestro_joinAppGroup($templateID, $app_group_id);
-  $variable_xref_array[34] = maestro_createTemplateVariable($templateID, "initiator", "");
-  $ti = new MaestroTaskInterfaceStart(0, $templateID);
+  $template_id = maestro_createNewTemplate("Test - Basic Batch Task Example", TRUE, TRUE, 500);
+  maestro_joinAppGroup($template_id, $app_group_id);
+  $variable_xref_array[34] = maestro_createTemplateVariable($template_id, "initiator", "");
+  $ti = new MaestroTaskInterfaceStart(0, $template_id);
   $ti->create();
   $task_xref_array[136] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -1299,7 +1298,7 @@ db_query($sql, array('a1' => $task_xref_array[29], 'b1' => $task_xref_array[23],
   $rec->offset_top = 152;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceEnd(0, $templateID);
+  $ti = new MaestroTaskInterfaceEnd(0, $template_id);
   $ti->create();
   $task_xref_array[137] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -1333,7 +1332,7 @@ db_query($sql, array('a1' => $task_xref_array[29], 'b1' => $task_xref_array[23],
   $rec->offset_top = 345;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceBatch(0, $templateID);
+  $ti = new MaestroTaskInterfaceBatch(0, $template_id);
   $ti->create();
   $task_xref_array[138] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -1367,7 +1366,7 @@ db_query($sql, array('a1' => $task_xref_array[29], 'b1' => $task_xref_array[23],
   $rec->offset_top = 153;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceIf(0, $templateID);
+  $ti = new MaestroTaskInterfaceIf(0, $template_id);
   $ti->create();
   $task_xref_array[139] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -1401,7 +1400,7 @@ db_query($sql, array('a1' => $task_xref_array[29], 'b1' => $task_xref_array[23],
   $rec->offset_top = 153;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $templateID);
+  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $template_id);
   $ti->create();
   $task_xref_array[140] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -1435,7 +1434,7 @@ db_query($sql, array('a1' => $task_xref_array[29], 'b1' => $task_xref_array[23],
   $rec->offset_top = 241;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $templateID);
+  $ti = new MaestroTaskInterfaceInteractiveFunction(0, $template_id);
   $ti->create();
   $task_xref_array[141] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -1480,27 +1479,27 @@ db_query($sql, array('a1' => $task_xref_array[29], 'b1' => $task_xref_array[23],
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[140], 'b1' => $task_xref_array[137], 'c1' => $task_xref_array[0]));
   $query = db_select('maestro_template_data', 'a');
-  $query->fields('a',array('task_class_name'));
-  $query->condition('a.id',$task_xref_array[140],'=');
+  $query->fields('a', array('task_class_name'));
+  $query->condition('a.id', $task_xref_array[140], '=');
   $name=current($query->execute()->fetchAll());
   $task_type = substr($name->task_class_name, 15);
   $task_class = 'MaestroTaskInterface' . $task_type;
-  $ti = new $task_class(0,0);
+  $ti = new $task_class(0, 0);
   $modulated_id = $variable_xref_array[34];
   $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";
-  db_query($sql, array( 'a1' => $task_xref_array[140],'b1' => 1,'c1' => 2,'d1' => $modulated_id,));
+  db_query($sql, array( 'a1' => $task_xref_array[140], 'b1' => 1, 'c1' => 2, 'd1' => $modulated_id));
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[141], 'b1' => $task_xref_array[137], 'c1' => $task_xref_array[0]));
   $query = db_select('maestro_template_data', 'a');
-  $query->fields('a',array('task_class_name'));
-  $query->condition('a.id',$task_xref_array[141],'=');
+  $query->fields('a', array('task_class_name'));
+  $query->condition('a.id', $task_xref_array[141], '=');
   $name=current($query->execute()->fetchAll());
   $task_type = substr($name->task_class_name, 15);
   $task_class = 'MaestroTaskInterface' . $task_type;
-  $ti = new $task_class(0,0);
+  $ti = new $task_class(0, 0);
   $modulated_id = $variable_xref_array[34];
   $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";
-  db_query($sql, array( 'a1' => $task_xref_array[141],'b1' => 1,'c1' => 2,'d1' => $modulated_id,));
+  db_query($sql, array( 'a1' => $task_xref_array[141], 'b1' => 1, 'c1' => 2, 'd1' => $modulated_id));
 
   /* Manual Web Sample */
   $_POST['offset_top'] = 0;
@@ -1509,10 +1508,10 @@ db_query($sql, array('a1' => $task_xref_array[29], 'b1' => $task_xref_array[23],
   $variable_xref_array[0] = 0;
   $task_xref_array = Array();
   $task_xref_array[0] = 0;
-  $templateID = maestro_createNewTemplate("Test - Manual Web Example", TRUE, TRUE, 500);
-  maestro_joinAppGroup($templateID, $app_group_id);
-  $variable_xref_array[49] = maestro_createTemplateVariable($templateID, "initiator", "");
-  $ti = new MaestroTaskInterfaceStart(0, $templateID);
+  $template_id = maestro_createNewTemplate("Test - Manual Web Example", TRUE, TRUE, 500);
+  maestro_joinAppGroup($template_id, $app_group_id);
+  $variable_xref_array[49] = maestro_createTemplateVariable($template_id, "initiator", "");
+  $ti = new MaestroTaskInterfaceStart(0, $template_id);
   $ti->create();
   $task_xref_array[212] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -1546,7 +1545,7 @@ db_query($sql, array('a1' => $task_xref_array[29], 'b1' => $task_xref_array[23],
   $rec->offset_top = 169;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceEnd(0, $templateID);
+  $ti = new MaestroTaskInterfaceEnd(0, $template_id);
   $ti->create();
   $task_xref_array[213] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -1580,7 +1579,7 @@ db_query($sql, array('a1' => $task_xref_array[29], 'b1' => $task_xref_array[23],
   $rec->offset_top = 174;
   $rec->surpress_first_notification = 0;
   drupal_write_record('maestro_template_data', $rec, array('id'));
-  $ti = new MaestroTaskInterfaceManualWeb(0, $templateID);
+  $ti = new MaestroTaskInterfaceManualWeb(0, $template_id);
   $ti->create();
   $task_xref_array[214] = $ti->get_task_id();
   $res = db_select('maestro_template_data', 'a');
@@ -1619,15 +1618,15 @@ db_query($sql, array('a1' => $task_xref_array[29], 'b1' => $task_xref_array[23],
   $sql  = "INSERT INTO {maestro_template_data_next_step} (template_data_from, template_data_to, template_data_to_false) VALUES (:a1, :b1, :c1)";
   db_query($sql, array('a1' => $task_xref_array[214], 'b1' => $task_xref_array[213], 'c1' => $task_xref_array[0]));
   $query = db_select('maestro_template_data', 'a');
-  $query->fields('a',array('task_class_name'));
-  $query->condition('a.id',$task_xref_array[214],'=');
+  $query->fields('a', array('task_class_name'));
+  $query->condition('a.id', $task_xref_array[214], '=');
   $name=current($query->execute()->fetchAll());
   $task_type = substr($name->task_class_name, 15);
   $task_class = 'MaestroTaskInterface' . $task_type;
-  $ti = new $task_class(0,0);
+  $ti = new $task_class(0, 0);
   $modulated_id = $variable_xref_array[49];
   $sql  = "INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1)";
-  db_query($sql, array( 'a1' => $task_xref_array[214],'b1' => 1,'c1' => 2,'d1' => $modulated_id,));
+  db_query($sql, array( 'a1' => $task_xref_array[214], 'b1' => 1, 'c1' => 2, 'd1' => $modulated_id));
 
 
 
@@ -1635,4 +1634,4 @@ db_query($sql, array('a1' => $task_xref_array[29], 'b1' => $task_xref_array[23],
 
 function maestro_test_flows_uninstall() {
 
-}
\ No newline at end of file
+}
