diff --git a/biblio.module b/biblio.module
index 4a22901..6cbaa6d 100644
--- a/biblio.module
+++ b/biblio.module
@@ -3,7 +3,7 @@
  * @file
  * Main file for Drupal module biblio.
  *
- * Copyright (C) 2006-2012  Ron Jerome
+ * Copyright (C) 2006-2008  Ron Jerome
  *
  *
 
@@ -116,10 +116,8 @@ function _biblio_get_field_information($biblio_type, $only_visible = FALSE) {
 function _biblio_localize_fields(&$fields) {
   if (module_exists('i18nstrings')) {
     foreach ($fields as $key => $row) {
-      if (isset($row['ftdid'])) {
-        $fields[$key]['title'] = tt("biblio:field:{$row['ftdid']}:title", $fields[$key]['title']);
-        $fields[$key]['hint'] = tt("biblio:field:{$row['ftdid']}:hint", $fields[$key]['hint']);
-      }
+      $fields[$key]['title'] = tt("biblio:field:{$row['ftdid']}:title", $fields[$key]['title']);
+      $fields[$key]['hint'] = tt("biblio:field:{$row['ftdid']}:hint", $fields[$key]['hint']);
     }
   }
 }
@@ -469,64 +467,79 @@ function biblio_help($path, $arg) {
       // This description is shown in the listing at admin/modules.
       return t('Manages a list of scholarly papers on your site');
     case 'node/add#biblio' :
-      // This description shows up when users click "create content."
+      // This description appears when users click "create content."
       return t('This allows you to add a bibliographic entry to the database');
   }
 }
+
+/**
+ * Implements hook_node_info().
+ */
 function biblio_node_info() {
   return array(
     'biblio' => array(
       'name' => t('Biblio'),
       'module' => 'biblio',
       'description' => t('Manages bibliographies')
-  )
+    )
   );
 }
+
 /**
- * Implementation of hook_access().
+ * Implements hook_access().
  *
- * Node modules may implement node_access() to determine the operations
- * users may perform on nodes. This example uses a very common access pattern.
+ * Node modules may implement node_access() to determine the operations users
+ * may perform on nodes. This function uses a very common access pattern.
  */
 function biblio_access($op, $node = '', $user = '') {
   switch ($op) {
     case 'create':
       return user_access('create biblio');
+
     case 'delete':
     case 'update':
       if (user_access('edit all biblio entries')) return TRUE;
-      if (!isset($user->uid)) return;
-      if (user_access('edit own biblio entries') && $user->uid == $node->uid) return TRUE;
+      if (user_access('edit own biblio entries') && isset($user->uid) && isset($node->uid) && $user->uid == $node->uid) return TRUE;
       break;
+
     case 'view':
-      if ((variable_get('biblio_view_only_own', 0)) && $user->uid != $node->uid) return FALSE;
+      if ((variable_get('biblio_view_only_own', 0)) && isset($user->uid) && isset($node->uid) && $user->uid != $node->uid) return FALSE;
       break;
+
     case 'admin':
       return user_access('administer biblio');
+
     case 'import':
       return user_access('import from file');
+
     case 'export':
       return user_access('show export links');
+
     case 'edit_author':
         if (user_access('administer biblio') || user_access('edit biblio authors')) return TRUE;
         break;
+
     case 'download':
-      if (user_access('show download links')) return TRUE;
-      if (!isset($user->uid)) return;
-      if (user_access('show own download links') && ($user->uid == $node->uid)) return TRUE;
+      if (user_access('show download links') ||
+         (user_access('show own download links') &&
+         (isset($user->uid) && isset($node->uid) && $user->uid == $node->uid))) return TRUE;
       break;
+
     case 'rss':
       return variable_get('biblio_rss', 0);
+
     default:
+      break;
   }
   return;
 }
+
 /**
- * Implementation of hook_perm().
+ * Implements hook_perm().
  *
- * Since we are limiting the ability to create new nodes to certain users,
- * we need to define what those permissions are here. We also define a permission
- * to allow users to edit the nodes they created.
+ * Since we are restricting users in various ways when they wish to create,
+ * view, update and/or delete biblio content, we need to define what those
+ * permissions are here.
  */
 function biblio_perm() {
   return array(
@@ -907,7 +920,7 @@ function biblio_menu() {
     'page callback'     => 'drupal_get_form',
     'page arguments'    => array('biblio_admin_io_mapper_add_form', 4, 5),
     'access arguments'  => array('administer biblio'),
-    'tab_parent'        => 'admin/settings/biblio/iomap',
+    'tab_parent'            => 'admin/settings/biblio/iomap',
     'file'              => '/includes/biblio.admin.inc',
     'type'              => MENU_CALLBACK,
     'weight'            => -1
@@ -1166,36 +1179,62 @@ function biblio_menu() {
   );
   return $items;
 }
+
+/**
+ * Implements hook_filter_clear().
+ */
 function biblio_filter_clear() {
-  $options = '';
   $_SESSION['biblio_filter'] = array();
   $base = variable_get('biblio_base', 'biblio');
+  $options = '';
   if (isset($_GET['sort'])) {
-    $options .= "sort=". $_GET['sort'];
+    $options .= "sort=" . $_GET['sort'];
   }
   if (isset($_GET['order'])) {
-    $options .= $options['query'] ? "&" : "";
-    $options .= "order=". $_GET['order'];
+    $options .= empty($options) ? "" : "&";
+    $options .= "order=" . $_GET['order'];
   }
   drupal_goto($base, $options);
 }
+
+/**
+ * Removes curly braces from a string.
+ *
+ * @param string $title_string
+ *   The text string to remove curly braces from.
+ *
+ * @return string
+ *   The resulting string with curly braces removed.
+ */
 function biblio_remove_brace($title_string){
-    //$title_string = utf8_encode($title_string);
-    $matchpattern = '/\{\$(?:(?!\$\}).)*\$\}|(\{[^}]*\})/';
-    $output = preg_replace_callback($matchpattern,'biblio_remove_brace_callback',$title_string);
-    return $output;
+  //$title_string = utf8_encode($title_string);
+  $matchpattern = '/\{\$(?:(?!\$\}).)*\$\}|(\{[^}]*\})/';
+  $output = preg_replace_callback($matchpattern, 'biblio_remove_brace_callback', $title_string);
+  return $output;
 }
 
-function biblio_remove_brace_callback($match){
-        if(isset($match[1])){
-                $braceless = str_replace('{', '', $match[1]);
-                $braceless = str_replace('}', '', $braceless);
-                return $braceless;
-        }
-        return $match[0];
+/**
+ * Assists in the removal of curly braces with preg_replace_callback().
+ *
+ * @param array $match
+ *
+ *
+ * @return string
+ *
+ */
+function biblio_remove_brace_callback($match) {
+  if (isset($match[1])) {
+    $braceless = str_replace('{', '', $match[1]);
+    $braceless = str_replace('}', '', $braceless);
+    return $braceless;
+  }
+  return $match[0];
 }
 
-function biblio_nodeapi(& $node, $op, $a3, $a4) {
+/**
+ * Implements hook_nodeapi().
+ */
+function biblio_nodeapi(&$node, $op, $a3, $a4) {
   if ($node->type == 'biblio') {
     switch ($op) {
       case 'delete revision' :
diff --git a/includes/biblio.pages.inc b/includes/biblio.pages.inc
index 4b9f8eb..131aaaf 100644
--- a/includes/biblio.pages.inc
+++ b/includes/biblio.pages.inc
@@ -99,50 +99,73 @@ function biblio_db_search() {
         }
       }
       // Wrong query (too short, only negative words etc.). Warning has been issued.
-      else $_SESSION['biblio_filter'] = array();
+      else {
+        $_SESSION['biblio_filter'] = array();
+      }
     }
   }
 
   $inline = in_array('inline', $arg_list);
-  $inline = in_array('profile', $arg_list)?'profile':$inline;
+  $inline = in_array('profile', $arg_list) ? 'profile' : $inline;
 
   $query_info = biblio_build_query($arg_list);
-  if ($query_info['rss']['feed']){
+
+  // If desired, prepare a listing in rss feed format which will print directly
+  // to the screen with no return value.
+  if ($query_info['rss']['feed']) {
     biblio_filter_feed($query_info['query'], $query_info['query_terms'], $query_info['rss']);
+    return;
   }
-  else{
-    //$count = db_result(db_query($query_info['count_query'],$query_info['query_terms']));
-    $nodes = array();
-    $result = pager_query($query_info['query'], variable_get('biblio_rowsperpage', 25),0,$query_info['count_query'],$query_info['query_terms']);
-    $query_info['filter_line'] = _biblio_filter_info_line($query_info['args']);
-
-    while ($res = db_fetch_array($result)) {
-      $node = node_load($res['nid']);
-      foreach($res as $key => $value) {
-        if (!isset($node->$key)) {
-          $node->$key = $value;
-        }
+
+  // Prepare an HTML formatted string for display in browser
+  $nodes = array();
+  $result = pager_query(
+              $query_info['query'],
+              variable_get('biblio_rowsperpage', 25),
+              0,
+              $query_info['count_query'],
+              $query_info['query_terms']
+            );
+  $query_info['filter_line'] = _biblio_filter_info_line($query_info['args']);
+
+  while ($res = db_fetch_array($result)) {
+    $node = node_load($res['nid']);
+    foreach($res as $key => $value) {
+      if (!isset($node->$key)) {
+        $node->$key = $value;
       }
-      $nodes[] = $node;
     }
-
-    return biblio_show_results($nodes, $query_info, $inline);
+    $nodes[] = $node;
   }
-
+  return biblio_show_results($nodes, $query_info, $inline);
 }
-/*
+
+/**
+ * Creates an SQL query to select and order biblio type content.
+ *
  * biblio_db_search builds the SQL query which will be used to
  * select and order "biblio" type nodes.  The query results are
  * then passed to biblio_show_results for output
  *
+ * @param $arg_list
+ *
  *
+ * @return array
+ *   An associative array with the following keys:
+ *   - query:
+ *   - query_terms:
+ *   - count_query:
+ *   - args:
+ *   - sort_attrib:
+ *   - rss:
  */
 function biblio_build_query($arg_list) {
   global $user, $db_type;
-  static $bcc = 0; //biblio_contributor (bc) count , increase for every invocation
-  static $bkd = 0;
-  static $tcc = 0; //term counter, increase for every invocation
-  $inline = $rss_info['feed'] = false;
+  static $bcc; //biblio_contributor (bc) count , increase for every invocation
+  static $tcc; //term counter, increase for every invocation
+  if (!isset($bcc)) $bcc = 0;
+  if (!isset($tcc)) $tcc = 0;
+  $inline = $rss_info['feed'] = FALSE;
   $joins = array();
   $selects = array();
   $count_selects = array();
@@ -190,113 +213,149 @@ function biblio_build_query($arg_list) {
 
   if (count($arg_list) ) {
     $args = array();
+
+    // Initialize various counters and variables
+    $bkd = 0;
+    $operator = '';
+
     while ($arg_list) {
       $type = $arg_list[0];
       array_shift($arg_list);
+      // The default operator is AND.
+      $operator = empty($operator) ? " AND " : $operator;
       switch ($type) {
         case 'no_filters':
           break;
+
+        case 'and':
+          $operator = " AND ";
+          break;
+
+        case 'or':
+          $operator = " OR ";
+          break;
+
         case 'inline':
-          $inline = true;
+          $inline = TRUE;
           break;
+
         case 'rss.xml':
-          $rss_info['feed'] = true;
-          $count_limit = 'LIMIT '. variable_get('biblio_rss_number_of_entries', 10);
+          $rss_info['feed'] = TRUE;
+          $count_limit = 'LIMIT ' . variable_get('biblio_rss_number_of_entries', 10);
           break;
+
         case 'profile':
           $inline = "profile";
           break;
+
         case 'cid':
         case 'aid':
           $bcc++;
           $term = explode("?",array_shift($arg_list));
-          $joins[] = "inner join {biblio_contributor} as bc". $bcc ." on n.vid = bc". $bcc .".vid";
-          $where[] = "bc". $bcc .".cid = '%d' ";
+          $joins[] = "inner join {biblio_contributor} as bc" . $bcc . " on n.vid = bc" . $bcc . ".vid";
+          $where[] = "bc" . $bcc . ".cid = '%d' ";
           $terms[] = db_escape_string($term[0]);
           array_push($args, $type, $term[0]);
           break;
+
         case 'term':
         case 'term_id':
           $term = explode("?",array_shift($arg_list));
-          $joins[] = "inner join {term_node} as tn". $tcc ." on n.vid = tn".$tcc.".vid";
+          $joins[] = "inner join {term_node} as tn" . $tcc . " on n.vid = tn" . $tcc . ".vid";
           if ($type == 'term') {
-            $joins[] = "inner join  {term_data} as td on tn". $tcc .".tid= td.tid";
+            $joins[] = "inner join {term_data} as td on tn" . $tcc . ".tid= td.tid";
             $where[] = "td.name = '%s' ";
-          }elseif ($type == 'term_id') {
-            $where[] = "tn". $tcc .".tid = '%d' ";
+          }
+          elseif ($type == 'term_id') {
+            $where[] = "tn" . $tcc . ".tid = '%d' ";
           }
           $terms[] = db_escape_string($term[0]);
           array_push($args, $type, $term[0]);
           $tcc++;
           break;
+
         case 'tg':
-          $term = explode("?",array_shift($arg_list));
+          $term = explode("?", array_shift($arg_list));
           $where[] = "substring($sort_title,1 ,1)" . $match_op . " LOWER('%s')";
           $terms[] = db_escape_string($term[0]);
           array_push($args, $type, $term[0]);
+          $operator = NULL;
           break;
-        case 'ag': //selects entries whoose authors firstname starts with the letter provided
-          $term = explode("?",array_shift($arg_list));
+
+        // Selects biblio content with the first name of authors that start with
+        // the specified letter.
+        case 'ag':
+          $term = explode("?", array_shift($arg_list));
           $where[] = " UPPER(substring(bcd.lastname,1,1)) = '%s' ";
-          //$where['bc-rank'] = "bc.rank=0";
           $joins['bc'] = '  INNER JOIN {biblio_contributor} as bc on b.vid = bc.vid ';
           $joins['bcd'] = '  JOIN {biblio_contributor_data} as bcd on bc.cid = bcd.cid ';
           $terms[] = db_escape_string(strtoupper($term[0]));
           array_push($args, $type, $term[0]);
+          $operator = NULL;
           break;
+
         case 'author':
           $bcc++;
           $term = explode("?",array_shift($arg_list));
 
           if (is_numeric($term[0])){
-            $joins[] = "inner join {biblio_contributor} as bc". $bcc ." on n.vid = bc". $bcc .".vid";
-            $cids = db_query('SELECT cid FROM {biblio_contributor_data}
-                              WHERE cid = %d OR aka = (SELECT aka FROM {biblio_contributor_data} WHERE cid = %d)'
-                              ,$term[0], $term[0]);
+            $joins[] = "inner join {biblio_contributor} as bc" . $bcc . " on n.vid = bc" . $bcc . ".vid";
+            $cids = db_query('SELECT cid FROM {biblio_contributor_data} ' .
+                             'WHERE cid = %d OR aka = (SELECT aka FROM {biblio_contributor_data} WHERE cid = %d)',
+                             $term[0], $term[0]);
             $wr = '';
             while ($cid = db_fetch_object($cids) ){
-              $wr .= empty($wr)?'':' OR ';
-              $wr .= "bc". $bcc .".cid = $cid->cid ";
+              $wr .= empty($wr) ? '' : ' OR ';
+              $wr .= "bc" . $bcc . ".cid = $cid->cid ";
             }
-            $where[] = (!empty($wr)) ? $wr : "bc". $bcc .".cid = -1 ";
-          }else{
-            $where[] = " bcd". $bcc .'.name '. $match_op .' "[[:<:]]%s[[:>:]]" ';
-            $joins[] = " JOIN {biblio_contributor} as bc". $bcc ." on b.vid = bc". $bcc .".vid ";
-            $joins[] = " JOIN {biblio_contributor_data} as bcd". $bcc ." on bc". $bcc .".cid = bcd".$bcc .".cid ";
+            $where[] = (!empty($wr)) ? $wr : "bc" . $bcc . ".cid = -1 ";
+          }
+          else {
+            $where[] = " bcd" . $bcc . '.name ' . $match_op . ' "[[:<:]]%s[[:>:]]" ';
+            $joins[] = " JOIN {biblio_contributor} as bc" . $bcc . " on b.vid = bc" . $bcc . ".vid ";
+            $joins[] = " JOIN {biblio_contributor_data} as bcd" . $bcc . " on bc" . $bcc . ".cid = bcd" . $bcc . ".cid ";
             $terms[] = db_escape_string($term[0]);
+            $operator = NULL;
             $rss_info['title'] = t("Publications by " . $term[0]);
-            $rss_info['description'] = t("These publications by %author are part of the works listed at %sitename", array('%author' => $term[0], '%sitename' => variable_get('site_name', 'Drupal')));
+            $rss_info['description'] = t("These publications by %author are part of the works listed at %sitename", array(
+                                         '%author' => $term[0],
+                                         '%sitename' => variable_get('site_name', 'Drupal')
+                                       ));
             $rss_info['link'] = '/author/' . $term[0];
           }
           array_push($args, $type, $term[0]);
           break;
+
         case 'publisher':
-          $term = explode("?",array_shift($arg_list));
-          $where[] = "b.biblio_publisher ". $match_op ." '%s' ";
+          $term = explode("?", array_shift($arg_list));
+          $where[] = "b.biblio_publisher " . $match_op . " '%s' ";
           $terms[] = db_escape_string($term[0]);
           array_push($args, $type, $term[0]);
+          $operator = NULL;
           break;
+
         case 'year':
           $term = db_escape_string(array_shift($arg_list));
           $where[] = "b.biblio_year=%d ";
-          //$limit .= " AND b.biblio_year=%d ";
-          $terms[] = (int)$term;
-          array_push($args, $type, (int)$term);
+          $terms[] = (int) $term;
+          array_push($args, $type, (int) $term);
+          $operator = NULL;
           break;
+
         case 'uid':
           $term = db_escape_string(array_shift($arg_list));
           $where[] = "n.uid=%d ";
-          //$limit .= " AND b.biblio_year=%d ";
-          $terms[] = (int)$term;
-          array_push($args, $type, (int)$term);
+          $terms[] = (int) $term;
+          array_push($args, $type, (int) $term);
+          $operator = NULL;
           break;
+
         case 'keyword':
           $bkd++;
-          $term = explode("?",array_shift($arg_list));
-          if (is_numeric($term[0])){
+          $term = explode("?", array_shift($arg_list));
+          if (is_numeric($term[0])) {
             $terms[] = db_escape_string($term[0]);
             $joins[] = "inner join {biblio_keyword} as bk$bkd on n.vid = bk$bkd.vid";
-          //$joins[] = "inner join {biblio_keyword_data} as bkd on bk.kid= bkd.kid";
             $where[] = "bk$bkd.kid = %d ";
           }
           elseif (strlen($term[0]) == 1) {
@@ -305,36 +364,43 @@ function biblio_build_query($arg_list) {
             $selects[] = "bkd.word as biblio_keyword";
             $where[] = " UPPER(substring(bkd.word,1,1)) = '%s' ";
             $terms[] = db_escape_string(strtoupper($term[0]));
-            //array_push($args, $type, $term[0]);
           }
-          else{
-            $where[] = " bkd". $bkd .'.word '. $match_op .' "[[:<:]]%s[[:>:]]" ';
-            $joins[] = " JOIN {biblio_keyword} as bk". $bkd ." on b.vid = bk". $bkd .".vid ";
-            $joins[] = " JOIN {biblio_keyword_data} as bkd". $bkd ." on bk". $bkd .".kid = bkd".$bkd .".kid ";
+          else {
+            $where[] = " bkd" . $bkd . '.word ' . $match_op . ' "[[:<:]]%s[[:>:]]" ';
+            $joins[] = " JOIN {biblio_keyword} as bk" . $bkd . " on b.vid = bk" . $bkd . ".vid ";
+            $joins[] = " JOIN {biblio_keyword_data} as bkd" . $bkd . " on bk" . $bkd . ".kid = bkd" . $bkd . ".kid ";
             $terms[] = db_escape_string($term[0]);
+            $operator = NULL;
             $rss_info['title'] = t("Keyword " . $term[0]);
-            $rss_info['description'] = t("These publications, containing the keyword: %keyword, are part of the works listed at %sitename", array('%keyword' => $term[0], '%sitename' => variable_get('site_name', 'Drupal')));
+            $rss_info['description'] = t("These publications, containing the keyword: %keyword, are part of the works listed at %sitename",
+                                         array('%keyword' => $term[0], '%sitename' => variable_get('site_name', 'Drupal')));
             $rss_info['link'] = '/keyword/' . $term[0];
           }
           array_push($args, $type, $term[0]);
+          $operator = NULL;
           break;
+
         case 'citekey':
-          $term = explode("?",array_shift($arg_list));
+          $term = explode("?", array_shift($arg_list));
           $terms[] = db_escape_string($term[0]);
           $where[] = "b.biblio_citekey= '%s' ";
           array_push($args, $type, $term[0]);
+          $operator = NULL;
           break;
+
         case 'type':
           $term = db_escape_string(array_shift($arg_list));
           $where[] = "b.biblio_type=%d ";
-          //$limit .= $operator. "b.biblio_type=%d ";
-          $terms[] = (int)$term;
-          array_push($args, $type, (int)$term);
+          $terms[] = (int) $term;
+          array_push($args, $type, (int) $term);
+          $operator = NULL;
           break;
+
         case 'order':
-          $term = (db_escape_string(strtolower(array_shift($arg_list))) == 'desc')?'desc':'asc';
+          $term = (db_escape_string(strtolower(array_shift($arg_list))) == 'desc') ? 'desc' : 'asc';
           $sort_attrib['order'] = $term;
           break;
+
         case 'sort':
           $term = db_escape_string(array_shift($arg_list));
           $sort_attrib['sort'] = $term;
@@ -343,10 +409,12 @@ function biblio_build_query($arg_list) {
               $sortby = "ORDER BY bt.name %s, $sort_title";
               $selects[] = "bt.name, $sort_title";
               break;
+
             case 'title':
               $sortby = "ORDER BY $sort_title %s";
               $selects[] = $sort_title;
               break;
+
             case 'author':
               $sortby = "ORDER BY bcd.lastname %s ";
               $where['bc-rank'] = "bc.rank=0";
@@ -355,62 +423,72 @@ function biblio_build_query($arg_list) {
               $joins['bcd'] = '  JOIN {biblio_contributor_data} as bcd on bc.cid = bcd.cid ';
               $selects[] = "bcd.lastname";
               break;
-            case 'keyword': // added msh 070808
+
+            case 'keyword':
               $sortby = "ORDER BY bkd.word %s ";
               $joins['bk'] = '  JOIN {biblio_keyword} as bk on b.vid = bk.vid ';
               $joins['bkd'] = '  LEFT JOIN {biblio_keyword_data} as bkd on bk.kid = bkd.kid ';
               $selects[] = "bkd.word as biblio_keyword";
-              //$count_selects[] = "bkd.word";
               break;
+
             case 'year':
             default:
               $sortby = "ORDER BY b.biblio_year %s, b.biblio_date %s, $sort_title %s";
               $selects[] = "b.biblio_year, b.biblio_date";
               $selects[] = $sort_title;
-          } //end switch
+          }
           break;
+
         case 'search':
           $term = explode("?",array_shift($arg_list));
-              $result_nids = split(',', $term[0]);
-              $where[] = "n.nid in (".db_placeholders($result_nids).")";
-              foreach ($result_nids as $result_nid) {
-                $terms[] = db_escape_string($result_nid);
-                array_push($args, $type, $result_nid);
-              }
-        // Save search keyword to show in the filter list.
-              $term = array_shift($arg_list);
-              array_push($args, $type, $term);
-              break;
-            default:
-              $fields = biblio_get_db_fields();
-              $term = explode("?",array_shift($arg_list));
-              if (in_array("biblio_$type",$fields))
-              {
-                $where[] = "b.biblio_$type ".$match_op ." '%s' ";
-                $terms[] = db_escape_string($term[0]);
-                array_push($args, $type, $term[0]);
-              }
-              break;
+          $result_nids = split(',', $term[0]);
+          $where[] = "n.nid in (" . db_placeholders($result_nids) . ")";
+          foreach ($result_nids as $result_nid) {
+            $terms[] = db_escape_string($result_nid);
+            array_push($args, $type, $result_nid);
+          }
+          // Save search keyword to show in the filter list.
+          $term = array_shift($arg_list);
+          array_push($args, $type, $term);
+          $operator = NULL;
+          break;
+
+        default:
+          $fields = biblio_get_db_fields();
+          $term = explode("?", array_shift($arg_list));
+          if (in_array("biblio_$type",$fields)) {
+            $where[] = "b.biblio_$type " . $match_op . " '%s' ";
+            $terms[] = db_escape_string($term[0]);
+            array_push($args, $type, $term[0]);
+            $operator = NULL;
+          }
+          break;
       }
     }
   }
   $where[] = "n.type='biblio' ";
+  // Only allow super admin user to view unpublished biblio content.
   if ($user->uid != 1 ) {
     $where[] = 'n.status = 1 ';
-  }//show only published entries to everyone except admin
+  }
 
   $select = implode(', ', $selects);
   $count_select = implode(', ', $count_selects);
   $join = implode(' ', $joins);
 
-  $where_clause = count($where) > 1 ? '('. implode(') AND (', $where) .')': $where[0];
+  $where_clause = count($where) > 1 ? '(' . implode(') AND (', $where) . ')' : $where[0];
 
-  $query = db_rewrite_sql("SELECT $select FROM {node} n $join  WHERE $where_clause $limit $sortby $count_limit");
-  $count_query = db_rewrite_sql("SELECT COUNT($count_select) FROM {node} n $join  WHERE $where_clause $limit $count_limit");
+  $query = db_rewrite_sql("SELECT $select FROM {node} n $join WHERE $where_clause $limit $sortby $count_limit");
+  $count_query = db_rewrite_sql("SELECT COUNT($count_select) FROM {node} n $join WHERE $where_clause $limit $count_limit");
   $_SESSION['last_biblio_query'] = $query;
-  $terms[] = $sort_attrib['order']; // this is either asc or desc to be inserted into the first term of the ORDER clause
-  if($sort_attrib['sort'] == 'year') {
-    $terms[] = $sort_attrib['order']; // we need any extra order term when sorting by year since there are to date terms biblio_year and biblio_date
+
+  // This will be either asc or desc that needs to be inserted into the first
+  // term of the ORDER BY clause.
+  $terms[] = $sort_attrib['order'];
+  if ($sort_attrib['sort'] == 'year') {
+    // An extra order term is needed when sorting by year since there are to
+    // date terms biblio_year and biblio_date.
+    $terms[] = $sort_attrib['order'];
     $terms[] = 'asc';
   }
   $_SESSION['last_biblio_query_terms'] = $terms;
@@ -483,21 +561,22 @@ function biblio_show_results($nodes, $query_info, $inline = FALSE) {
     }
   }
 
-  if ($inline === true) print '<div class="biblio-inline">';
+  if ($inline === TRUE) print '<div class="biblio-inline">';
 
-  if (isset($_GET['sort'])) {
-    $value = '';
-    if ($_GET['sort'] == 'title' ||
-        $_GET['sort'] == 'author' ||
-        $_GET['sort'] == 'keyword') {
-      if (strpos($_GET['q'],'ag') ||
-          strpos($_GET['q'],'tg') ||
-          strpos($_GET['q'],'keyword')) {
-        $value = substr($_GET['q'],strrpos($_GET['q'],'/') + 1);
-      }
-      $content .= theme('biblio_alpha_line', $_GET['sort'], $value);
+  if (isset($_GET['sort']) &&
+     ($_GET['sort'] == 'title' ||
+      $_GET['sort'] == 'author' ||
+      $_GET['sort'] == 'keyword')
+     ) {
+    $value = $_GET['q'];
+    if (strpos($_GET['q'],'ag') ||
+        strpos($_GET['q'],'tg') ||
+        strpos($_GET['q'],'keyword')) {
+      $value = substr($_GET['q'],strrpos($_GET['q'],'/')+1);
     }
+    $content .= theme('biblio_alpha_line', $_GET['sort'], $value);
   }
+
   $count = 0;
 
   // Reset separator bar status for repeated calls to biblio_db_search.
@@ -595,35 +674,60 @@ function _biblio_sort_tabs($attrib, $options = NULL) {
       $tab['arrow'] = '';
       $content .= _biblio_sort_tab($tab, $tabs);
     }
-
   }
-  if (!$tabs) $content = t('Sort by').': '.$content;
-  $content .= $tabs ? '</ul>':'';
+  if ($tabs) {
+    $content .= '</ul>';
+  }
+  else {
+    $content = t('Sort by') . ': ' . $content;
+  }
 
   return $content;
 }
 
+/**
+ * Page callback: Creates ...
+ *
+ * @param array $tab
+ *   An associative array with the following elements:
+ *   - text:
+ *   - arrow:
+ *   - attributes: An array with an optional class key.
+ * @param bool $tabs
+ *   (optional)
+ *
+ * @return string
+ *
+ */
 function _biblio_sort_tab($tab, $tabs = FALSE) {
   if ($tabs) {
-    $text  = '<span class="a"><span class="b">'.$tab['text'].$tab['arrow'].'</span></span>';
-    $class = (isset($tab['attributes']['class'])) ? 'class="active"' : '';
+    $text  = '<span class="a"><span class="b">' . $tab['text'] . $tab['arrow'] . '</span></span>';
+    $class = (isset($tab['attributes']['class']) && $tab['attributes']['class']) ? 'class="active"' : '';
     $link  = l($text, $tab['path'], $tab);
     return "<li $class >" . str_replace('class="active"', $class, $link) . '</li>';
   }
   else {
-    return $tab['pfx']. l($tab['text'], $tab['path'], $tab) . $tab['arrow'] . $tab['sfx'];
+    return $tab['pfx'] . l($tab['text'], $tab['path'], $tab) . $tab['arrow'] . $tab['sfx'];
   }
-  return;
 }
 
-function _biblio_filter_info_line($args) {
+/**
+ * Page callback: Creates ...
+ *
+ * @param array $args
+ *
+ *
+ * @return string $content
+ *   An HTML formatted string ...
+ */
+function _biblio_filter_info_line(array $args) {
   module_load_include('inc', 'biblio', 'includes/biblio.contributors');
   $content = '';
   $filtercontent = '';
   $search_content = '';
   $base =  variable_get('biblio_base', 'biblio');
   $session = &$_SESSION['biblio_filter'];
-  // if there are any filters in place, print them at the top of the list
+  // If there are any filters in place, print them at the top of the list.
   if (count($args)) {
     $i = 0;
     while ($args) {
@@ -673,45 +777,62 @@ function _biblio_filter_info_line($args) {
         }
       }
       array_shift($args);
-      $params = array('%a' =>  check_plain(ucwords($type)) , '%b' =>  check_plain($value) );
-      $filtercontent .= ($i++ ? t('<em> and</em> <strong>%a</strong> is <strong>%b</strong>', $params) : t('<strong>%a</strong> is <strong>%b</strong>', $params)) ;
+      $params = array('%a' => check_plain(ucwords($type)), '%b' =>  check_plain($value));
+      $filtercontent .= ($i++)
+                          ? t('<em> and</em> <strong>%a</strong> is <strong>%b</strong>', $params)
+                          : t('<strong>%a</strong> is <strong>%b</strong>', $params);
     }
     if ($search_content) {
-      $content .= '<div class="biblio-current-filters"><b>'.t('Search results for ').'</b>';
-      $content .= '<em>'. check_plain($search_content) .'</em>';
+      $content .= '<div class="biblio-current-filters"><b>' . t('Search results for ') . '</b>';
+      $content .= '<em>' . check_plain($search_content) . '</em>';
       if ($filtercontent) {
-        $content .= '<br><b>'.t('Filters').': </b>';
+        $content .= '<br><b>' . t('Filters') . ': </b>';
       }
     }
     else {
-      $content .= '<div class="biblio-current-filters"><b>'.t('Filters').': </b>';
+      $content .= '<div class="biblio-current-filters"><b>' . t('Filters') . ': </b>';
     }
     $content .= $filtercontent;
 
     $link_options = array();
-    $link_options['query'] = '';
     if (isset($_GET['sort'])) {
-      $link_options['query']  .= "sort=" . $_GET['sort'];
+      $link_options['query'] = "sort=" . $_GET['sort'];
     }
     if (isset($_GET['order'])) {
-      $link_options['query']   .= $link_options['query'] ? "&" : "" ;
-      $link_options['query']   .= "order=" . $_GET['order'];
+      $link_options['query'] .= $link_options['query'] ? "&" : "" ;
+      $link_options['query'] .= "order=" . $_GET['order'];
     }
 
     if ($search_content) {
-      $content .= '&nbsp;&nbsp;'.l('['.t('Reset Search').']',"$base/filter/clear", $link_options);
-    } else {
-      $content .= '&nbsp;&nbsp;'.l('['.t('Clear All Filters').']',"$base/filter/clear", $link_options);
+      $content .= '&nbsp;&nbsp;' . l('[' . t('Reset Search') . ']', "$base/filter/clear", $link_options);
+    }
+    else {
+      $content .= '&nbsp;&nbsp;' . l('[' . t('Clear All Filters') . ']', "$base/filter/clear", $link_options);
     }
     $content .= '</div>';
   }
-
   return $content;
 }
 
+/**
+ * Page callback: Creates ...
+ *
+ * @param array $attrib
+ *
+ * @param object $node
+ *
+ * @param bool $reset
+ *
+ *
+ * @return null|string
+ *
+ */
 function _biblio_category_separator_bar($attrib, $node, $reset = FALSE) {
   static $_text = '';
-  if ($reset) { $_text = ''; return;}
+  if ($reset) {
+    $_text = '';
+    return;
+  }
   $content = '';
 
   switch ($attrib['sort']) {
@@ -1180,12 +1301,11 @@ function biblio_citekey_view() {
  */
 function _biblio_keyword_links($keywords, $base = 'biblio') {
   $options = array();
-  $options['query'] = '';
-  
   if (isset($_GET['sort'])) {
     $options['query'] = "sort=" . $_GET['sort'];
   }
   if (isset($_GET['order'])) {
+    if (!isset($options['query'])) $options['query'] = '';
     $options['query'] .= empty($options['query']) ? "" : "?";
     $options['query'] .= "order=" . $_GET['order'];
   }
@@ -1203,14 +1323,31 @@ function _biblio_keyword_links($keywords, $base = 'biblio') {
   return $html;
 }
 
+/**
+ *
+ *
+ * @param array $filter
+ *   (optional)
+ *
+ * @return string
+ *   An HTML formatted string with biblio author information.
+ */
 function biblio_author_page($filter = NULL) {
   $path = drupal_get_path('module', 'biblio');
   drupal_add_js($path . '/misc/biblio.highlight.js');
   $authors = _biblio_get_authors($filter);
-
   return _biblio_format_author_page($filter, $authors);
 }
 
+/**
+ *
+ *
+ * @param array $filter
+ *   (optional)
+ *
+ * @return array
+ *
+ */
 function _biblio_get_authors($filter = NULL) {
   global $user;
   $where = array();
@@ -1295,11 +1432,8 @@ function _biblio_format_author_page($filter, $authors) {
     }
     $checkbox = array(
       '#title' => t('Hightlight possible duplicates'),
-      '#name'  => 'duplicate_authors',
-      '#value' => 0,
       '#type'  => 'checkbox',
       '#id'    => 'biblio-highlight',
-      '#parents' => array(''),
     );
     $checkbox = '<div class="biblio-alpha-line">' . drupal_render($checkbox) . '</div>';
     $header = array(array('data' => t('There are a total of @count authors in the database!header_ext.', array('@count' => count($authors), '!header_ext' => $header_ext)), 'align' =>'center', 'colspan' => 3));
@@ -1343,81 +1477,140 @@ function _biblio_format_author($author) {
   return $format;
 }
 
+/**
+ *
+ *
+ * @param array $author
+ *
+ *
+ * @return string
+ *
+ */
 function _biblio_author_edit_links($author) {
   static $path = '';
   if (empty($path)){
     $path =  (ord(substr($_GET['q'],-1)) > 97) ? $_GET['q'] . "/" : substr($_GET['q'], 0, -1);
     $path = (strpos($path, 'list/')) ? str_replace('list/', '', $path) : $path;
   }
-  return l(' ['.t('edit').']', $path . $author['cid'] ."/edit/" );
+  return l(' [' . t('edit') . ']', $path . $author['cid'] . "/edit/" );
 }
 
+/**
+ *
+ *
+ * @param array $filter
+ *
+ *
+ * @return string
+ *
+ */
 function biblio_keyword_page($filter = NULL) {
   $keywords = _biblio_get_keywords($filter);
   return _biblio_format_keyword_page($filter, $keywords);
 }
 
+/**
+ *
+ *
+ * @param array $filter
+ *
+ *
+ * @return array
+ *
+ */
 function _biblio_get_keywords($filter = NULL) {
   global $user;
+  $keywords = array();
   $where = array();
   $where_clause = '';
+  
   if ($filter) {
     $filter = strtoupper($filter);
     $where[] =  "UPPER(SUBSTRING(word,1,1)) = '%s' ";
-    $header_ext = t(' (which start with the letter "@letter") ',array('@letter' => $filter ));
+    $header_ext = t(' (which start with the letter "@letter") ', array('@letter' => $filter));
   }
   else {
-    $query_ext =  NULL;
+    $query_ext = NULL;
     $header_ext = NULL;
   }
 
-  if ($user->uid != 1 ) {//show only published entries to everyone except admin
+  // Never show unpublished biblio content (except super admin user).
+  if ($user->uid != 1) {
     $where[] = 'n.status = 1 ';
   }
-
-  if (variable_get('biblio_view_only_own', 0) ) {//show only authors that belong to nodes that the user has access to
+  
+  // Possibly restrict access to biblio content one has permission to view.
+  if (variable_get('biblio_view_only_own', 0) ) {
     $where[] = "n.uid = $user->uid";
   }
   if (count($where)) {
-    $where_clause = count($where) > 1 ? 'WHERE ('. implode(') AND (', $where) .')': 'WHERE '. $where[0];
-  }
-
-  $db_result = db_query('SELECT bkd.kid, bkd.word, COUNT(*) AS cnt
-                         FROM {biblio_keyword} bk
-                         LEFT JOIN {biblio_keyword_data} bkd ON bkd.kid = bk.kid
-                         INNER JOIN {node} n ON n.vid = bk.vid
-                         '. $where_clause. '
-                         GROUP BY bkd.kid, bkd.word HAVING COUNT(*) > 0
-                         ORDER BY  word ASC', $filter);
-
+    $where_clause = count($where) > 1 
+                      ? 'WHERE (' . implode(') AND (', $where) . ')' 
+                      : 'WHERE ' . $where[0];
+  }
+  $sql = 'SELECT bkd.kid, bkd.word, COUNT(*) AS cnt ' .
+         'FROM {biblio_keyword} bk ' .
+           'LEFT JOIN {biblio_keyword_data} bkd ON bkd.kid = bk.kid ' .
+           'INNER JOIN {node} n ON n.vid = bk.vid ' .
+         $where_clause . ' ' .
+         'GROUP BY bkd.kid, bkd.word HAVING COUNT(*) > 0 ' .
+         'ORDER BY word ASC';
+  $db_result = db_query($sql, $filter);
   while ($keyword = db_fetch_object($db_result)){
     $keywords[] = $keyword;
   }
   return $keywords;
 }
 
+/**
+ * Page callback: 
+ *
+ * @param array $filter
+ *
+ * @param array $keywords
+ *
+ *
+ * @return string
+ *
+ */
 function _biblio_format_keyword_page($filter, $keywords) {
   $header = array();
-  $rows = array();
+	$rows = array();
   $output = '';
-
-  $rows[] = array(array('data' => theme('biblio_alpha_line', 'keywords', $filter), 'colspan' => 3));
-  for ($i=0; $i < count($keywords); $i+=3) {
-    $rows[] = array( array('data' => _biblio_format_keyword($keywords[$i]) ),
-    array('data' => isset($keywords[$i+1])?_biblio_format_keyword($keywords[$i+1]):'' ),
-    array('data' => isset($keywords[$i+2])?_biblio_format_keyword($keywords[$i+2]):'' ));
+	$alphabar = theme('biblio_alpha_line', 'keywords', $filter);
+  $rows[] = array(array('data' => $alphabar, 'colspan' => 3));
+  for ($i = 0; $i < count($keywords); $i += 3) {
+    $rows[] = array( 
+      array('data' => _biblio_format_keyword($keywords[$i]) ),
+      array('data' => isset($keywords[$i+1]) ? _biblio_format_keyword($keywords[$i+1]) : ''),
+      array('data' => isset($keywords[$i+2]) ? _biblio_format_keyword($keywords[$i+2]) : '')
+    );
   }
-  //$header = array(array('data' => t('There are a total of @count keywords !header_ext in the database',array('@count' => count($keywords), '!header_ext' => $header_ext)), 'align' =>'center', 'colspan' => 3));
+  // $header = array(
+  //             array('data' => t('There are a total of @count keywords !header_ext in the database', array(
+  //               '@count' => count($keywords), 
+  //               '!header_ext' => $header_ext
+  //             )), 'align' =>'center', 'colspan' => 3
+  //           ));
   $output .= theme('table', $header, $rows);
   return $output;
 }
-function _biblio_format_keyword($keyword) {
-  $base      = variable_get('biblio_base', 'biblio');
-  $format    = l(trim($keyword->word), "$base/keyword/$keyword->kid" );
-  $format   .= ' ('. $keyword->cnt . ') ' ;
-  $path =  (ord(substr($_GET['q'],-1)) > 97) ? $_GET['q'] . "/" : substr($_GET['q'], 0, -1);
-  $edit_link = ' ['.l(t('edit'), $path . $keyword->kid . "/edit" ).'] ';
-  $format   .= (user_access('administer biblio')) ? $edit_link: '';
 
+/**
+ *
+ *
+ * @param object $keyword
+ *
+ *
+ * @return string
+ *
+ */
+function _biblio_format_keyword($keyword) {
+  $base = variable_get('biblio_base', 'biblio');
+  $format  = l(trim($keyword->word), "$base/keyword/$keyword->kid");
+  $format .= ' (' . $keyword->cnt . ') ';
+  $path = (ord(substr($_GET['q'], -1)) > 97) ? $_GET['q'] . "/" : substr($_GET['q'], 0, -1);
+  $edit_link = ' ['. l(t('edit'), $path . $keyword->kid . "/edit" ) . '] ';
+  $format .= (user_access('administer biblio')) ? $edit_link : '';
   return $format;
 }
diff --git a/includes/biblio_theme.inc b/includes/biblio_theme.inc
index 7bb9eec..5a5d81a 100644
--- a/includes/biblio_theme.inc
+++ b/includes/biblio_theme.inc
@@ -90,8 +90,8 @@ function biblio_openURL($node) {
 
   $query["ctx_ver"]= "Z39.88-2004";
   foreach ($co as $coKey => $coValue) {
-    $coKey = preg_replace("/rft./", "", $coKey);
-    $coKey = preg_replace("/au[0-9]*/", "au", $coKey);
+    $coKey = ereg_replace("rft.", "", $coKey);
+    $coKey = ereg_replace("au[0-9]*", "au", $coKey);
     $query[$coKey] = rawurlencode($coValue);
   }
 
@@ -514,9 +514,11 @@ function theme_biblio_format_authors($contributors, $options, $inline = false)
         //$author['initials'] = str_replace(' ', '',  $author['initials']);
 
         // within initials, add a space after a hyphen, but only if ...
-        if (preg_match('/ $/', $options['betweenInitialsDelim'])) { // ... the delimiter that separates initials ends with a space
+        // ... the delimiter that separates initials ends with a space
+        if (preg_match('/ $/', $options['betweenInitialsDelim'])) { 
           $author['initials'] = preg_replace("/-(?=[$upper])/$patternModifiers", "- ", $author['initials']);
         }
+        
         // then, separate initials with the specified delimiter:
         $delim = $options['betweenInitialsDelim'];
         $author['initials'] = preg_replace("/([$upper])(?=[^$lower]+|$)/$patternModifiers", "\\1$delim", $author['initials']);
@@ -580,10 +582,10 @@ function theme_biblio_format_authors($contributors, $options, $inline = false)
       // we'll append the string in '$customStringAfterFirstAuthors' to the number of authors given in '$includeNumberOfAuthors' if the total number of authors is greater than the number given in '$numberOfAuthorsTriggeringEtAl':
       if ((($rank + 1) == $options['includeNumberOfAuthors']) AND ($authorCount > $options['numberOfAuthorsTriggeringEtAl']))
       {
-        if (preg_match("/__NUMBER_OF_AUTHORS__/", $options['customStringAfterFirstAuthors'])) {
+        if (preg_replace('/__NUMBER_OF_AUTHORS__/', $options['customStringAfterFirstAuthors'])) {
           $customStringAfterFirstAuthors = preg_replace("/__NUMBER_OF_AUTHORS__/", ($authorCount - $options['includeNumberOfAuthors']), $options['customStringAfterFirstAuthors']); // resolve placeholder
         }
-        $includeStringAfterFirstAuthor = true;
+        $includeStringAfterFirstAuthor = TRUE;
         break;
       }
     }
@@ -605,23 +607,24 @@ function theme_biblio_format_authors($contributors, $options, $inline = false)
 
   return $output;
 }
-/**
- * Returns HTML for an author link.
- *
- * @param array $author
- *   An associative array with information about an author including elements:
- *   - name: A string with the author's name.
- *   - cid: An integer identifying the author in biblio module.
- *   - drupal_uid: (optional) An integer linking to Drupal user ID.
- *
- * @ingroup themeable
- */
 
+/**
+ * Returns HTML for an author link.
+ *
+ * @param array $author
+ *   An associative array with information about an author including elements:
+ *   - name: A string with the author's name.
+ *   - cid: An integer identifying the author in biblio module.
+ *   - drupal_uid: (optional) An integer linking to Drupal user ID.
+ *
+ * @ingroup themeable
+ */
 function theme_biblio_author_link($author) {
   $base = variable_get('biblio_base', 'biblio');
   $link_to_profile = variable_get('biblio_author_link_profile', 0);
   $link_to_profile_path = variable_get('biblio_author_link_profile_path', 'user/[uid]');
   $options = array();
+  $inline = isset($inline) ? "/inline" : "";
   $language = isset($node->language) ? $node->language : '';
 
   if (isset($_GET['sort'])) {
@@ -639,7 +642,7 @@ function theme_biblio_author_link($author) {
     $options = array_merge($options, array('attributes' => array('target' => '_blank'), 'html' => TRUE));
   }
 
-  if ($link_to_profile && isset($author['drupal_uid'])) {
+  if ($link_to_profile && isset($author['drupal_uid']) && $author['drupal_uid']) {
     $data['user'] = user_load($author['drupal_uid']);
     $path = token_replace_multiple($link_to_profile_path, $data);
     $alias = drupal_get_path_alias($path, $language);
@@ -647,7 +650,7 @@ function theme_biblio_author_link($author) {
     return l(trim($author['name']), $path_profile, $options);
   }
   else {
-    return l(trim($author['name']), "$base/author/". $author['cid'], $options );
+    return l(trim($author['name']), "$base/author/" . $author['cid'] . $inline, $options);
   }
   return $html;
 }
@@ -939,8 +942,6 @@ function theme_biblio_download_links($node = NULL) {
  * @return an un-ordered list of class "biblio-export-buttons"
  */
 function theme_biblio_export_links($node = NULL) {
-  if (!isset($node->nid)) return;
-  $output = '';
   global $pager_total_items;
   $links = array();
   $base = variable_get('biblio_base', 'biblio');
@@ -968,9 +969,7 @@ function theme_google_scholar_link($node) {
 
   $query['btnG'] = 'Search+Scholar';
   $query['as_q'] = '"'.str_replace(array(' ', '(', ')'), array('+'), $node->title).'"'; // as_q = all the words
-  if (isset($node->biblio_contributors[1])) {
-    $query['as_sauthors'] = $node->biblio_contributors[1][0]['lastname'];
-  }
+  $query['as_sauthors'] = $node->biblio_contributors[1][0]['lastname'];
   $query['as_occt'] = 'any';
   $query['as_epq'] = ''; // exact phrase
   $query['as_oq'] = ''; // at least one of the words
diff --git a/styles/biblio_style_classic.inc b/styles/biblio_style_classic.inc
index f11baab..1b2ff92 100644
--- a/styles/biblio_style_classic.inc
+++ b/styles/biblio_style_classic.inc
@@ -1,111 +1,112 @@
-<?PHP
-
-/**
- * @file
- * Functions for rendering biblio item information in classic style.
- */
-
-/**
- * Get the style information.
- *
- * @return array
- *   The name of the style.
- */
-function biblio_style_classic_info() {
-  return array (
-    'classic' => 'Classic - This is the original biblio style'
-  );
-}
-
-/**
- *
- * 
- * @return array
- *   An array of author styling options for the classic style.
- */
-function biblio_style_classic_author_options() {
-  $author_options = array(
-    'BetweenAuthorsDelimStandard'     =>  ', ',        //  4
-    'BetweenAuthorsDelimLastAuthor'   =>  ', and ',    //  5
-    'AuthorsInitialsDelimFirstAuthor' =>  ', ',        //  7
-    'AuthorsInitialsDelimStandard'    =>  ' ',         //  8
-    'betweenInitialsDelim'            =>  '. ',        //  9
-    'initialsBeforeAuthorFirstAuthor' =>  FALSE,       // 10
-    'initialsBeforeAuthorStandard'    =>  FALSE,       // 11
-    'shortenGivenNames'               =>  FALSE,       // 12
-    'numberOfAuthorsTriggeringEtAl'   =>  10,          // 13
-    'includeNumberOfAuthors'          =>  10,          // 14
-    'customStringAfterFirstAuthors'   =>  ', et al.',  // 15
-    'encodeHTML'                      =>  TRUE
-  );
-  return $author_options;
-}
-
-/**
- * Apply a bibliographic style to the node
- *
- *
- * @param $node
- *   An object containing the node data to render
- * @param $base
- *   The base URL of the biblio module (defaults to /biblio)
- * @param $inline
- *   A logical value indicating if this is being rendered within the
- *   Drupal framwork (false) or we are just passing back the html (true)
- * @return
- *   The styled biblio entry
- */
-function biblio_style_classic($node, $base = 'biblio', $inline = FALSE) {
-  $output = '';
-  $author_options = biblio_style_classic_author_options();
-  if (isset($node->biblio_contributors[1])) {
-    $authors = theme('biblio_format_authors', $node->biblio_contributors[1], $author_options, $inline);
-  }
-  if (!empty ($node->biblio_citekey)&&(variable_get('biblio_display_citation_key',0))) {
-    $output .= '[' . check_plain($node->biblio_citekey) . '] ';
-  }
-  $output .= '<span class="biblio-title">';
-  $url = biblio_get_title_url_info($node);
-  $output .= l($node->title, $url['link'], $url['options']);
-  $output .= "</span>, \n";
-  $output .= '<span class="biblio-authors">' . $authors . "</span> \n";
-  if ($node->biblio_secondary_title) {
-    $output .= ', ' . check_plain($node->biblio_secondary_title);
-  }
-  if ($node->biblio_date)
-    $output .= ', ' . check_plain($node->biblio_date);
-  if ($node->biblio_volume)
-    $output .= ', Volume ' . check_plain($node->biblio_volume);
-  if ($node->biblio_issue)
-    $output .= ', Issue ' . check_plain($node->biblio_issue);
-  if ($node->biblio_number)
-    $output .= ', Number ' . check_plain($node->biblio_number);
-  if ($node->biblio_place_published)
-    $output .= ', ' . check_plain($node->biblio_place_published);
-  if ($node->biblio_pages)
-    $output .= ', p.' . check_plain($node->biblio_pages);
-  if (isset ($node->biblio_year)) {
-    $output .= ', (' . check_plain($node->biblio_year) . ")\n";
-  }
-  return filter_xss($output, biblio_get_allowed_tags());
-}
-
-/**
- * Creates a string with the author's nname in classic format.
- *
- * @param array $author
- *   An associative arry with the following keys:
- *   - prefix:
- *   - lastname:
- *   - firstname: 
- *   - initials: 
- *
- * @return string
- *   A string representing the author's name in classic format.
- */
-function _classic_format_author($author) {
-  $format = $author['prefix'] . ' ' . $author['lastname'] . ' ';
-  $format .= !empty ($author['firstname']) ? ' ' . drupal_substr($author['firstname'], 0, 1) : '';
-  $format .= !empty ($author['initials']) ? str_replace(' ', '', $author['initials']) : '';
-  return $format;
-}
\ No newline at end of file
+<?PHP
+
+/**
+ * @file
+ * Functions for rendering biblio item information in classic style.
+ */
+
+/**
+ * Get the style information.
+ *
+ * @return array
+ *   The name of the style.
+ */
+function biblio_style_classic_info() {
+  return array (
+    'classic' => 'Classic - This is the original biblio style'
+  );
+}
+
+/**
+ *
+ * 
+ * @return array
+ *   An array of author styling options for the classic style.
+ */
+function biblio_style_classic_author_options() {
+  $author_options = array(
+    'BetweenAuthorsDelimStandard'     =>  ', ',        //  4
+    'BetweenAuthorsDelimLastAuthor'   =>  ', and ',    //  5
+    'AuthorsInitialsDelimFirstAuthor' =>  ', ',        //  7
+    'AuthorsInitialsDelimStandard'    =>  ' ',         //  8
+    'betweenInitialsDelim'            =>  '. ',        //  9
+    'initialsBeforeAuthorFirstAuthor' =>  FALSE,       // 10
+    'initialsBeforeAuthorStandard'    =>  FALSE,       // 11
+    'shortenGivenNames'               =>  FALSE,       // 12
+    'numberOfAuthorsTriggeringEtAl'   =>  10,          // 13
+    'includeNumberOfAuthors'          =>  10,          // 14
+    'customStringAfterFirstAuthors'   =>  ', et al.',  // 15
+    'encodeHTML'                      =>  TRUE
+  );
+  return $author_options;
+}
+
+/**
+ * Apply a bibliographic style to the biblio node.
+ *
+ * @param $node
+ *   An object containing the node data to render.
+ * @param $base
+ *   The base URL of the biblio module (defaults to /biblio).
+ * @param $inline
+ *   A logical value indicating if this is being rendered within the
+ *   Drupal framwork (false) or we are just passing back the html (true).
+ *
+ * @return
+ *   The styled biblio entry.
+ */
+function biblio_style_classic($node, $base = 'biblio', $inline = FALSE) {
+  $output = '';
+  $author_options = biblio_style_classic_author_options();
+  $authors = '';
+  if (isset($node->biblio_contributors[1])) {
+    $authors = theme('biblio_format_authors', $node->biblio_contributors[1], $author_options, $inline);
+  }
+  if (!empty($node->biblio_citekey) && variable_get('biblio_display_citation_key', 0)) {
+    $output .= '[' . check_plain($node->biblio_citekey) . '] ';
+  }
+  $output .= '<span class="biblio-title">';
+  $url = biblio_get_title_url_info($node);
+  $output .= l($node->title, $url['link'], $url['options']);
+  $output .= "</span>, \n";
+  $output .= '<span class="biblio-authors">' . $authors . "</span> \n";
+  if ($node->biblio_secondary_title) {
+    $output .= ', ' . check_plain($node->biblio_secondary_title);
+  }
+  if ($node->biblio_date)
+    $output .= ', ' . check_plain($node->biblio_date);
+  if ($node->biblio_volume)
+    $output .= ', Volume ' . check_plain($node->biblio_volume);
+  if ($node->biblio_issue)
+    $output .= ', Issue ' . check_plain($node->biblio_issue);
+  if ($node->biblio_number)
+    $output .= ', Number ' . check_plain($node->biblio_number);
+  if ($node->biblio_place_published)
+    $output .= ', ' . check_plain($node->biblio_place_published);
+  if ($node->biblio_pages)
+    $output .= ', p.' . check_plain($node->biblio_pages);
+  if (isset ($node->biblio_year)) {
+    $output .= ', (' . check_plain($node->biblio_year) . ")\n";
+  }
+  return filter_xss($output, biblio_get_allowed_tags());
+}
+
+/**
+ * Creates a string with the author's nname in classic format.
+ *
+ * @param array $author
+ *   An associative arry with the following keys:
+ *   - prefix:
+ *   - lastname:
+ *   - firstname: 
+ *   - initials: 
+ *
+ * @return string
+ *   A string representing the author's name in classic format.
+ */
+function _classic_format_author($author) {
+  $format = $author['prefix'] . ' ' . $author['lastname'] . ' ';
+  $format .= !empty ($author['firstname']) ? ' ' . drupal_substr($author['firstname'], 0, 1) : '';
+  $format .= !empty ($author['initials']) ? str_replace(' ', '', $author['initials']) : '';
+  return $format;
+}
