diff --git a/biblio.module b/biblio.module
index 7d27043..795cc49 100644
--- a/biblio.module
+++ b/biblio.module
@@ -21,6 +21,18 @@
  */
 define('BIBLIO_VERSION', '6.x-2.x-dev');
 
+/**
+ * Retrieves author types based upon author category and biblio type.
+ *
+ * @param string $auth_category
+ *   A string representing the category of author.
+ * @param string $biblio_type
+ *   A string representing the type of biblio item.
+ *
+ * @return array|null
+ *   An associative array keyed by author category and biblio type.  NULL is
+ *   returned if no matches could be found.
+ */
 function _biblio_get_auth_types($auth_category, $biblio_type) {
   static $auth_types = array();
   if (empty($auth_types)) {
@@ -29,16 +41,45 @@ function _biblio_get_auth_types($auth_category, $biblio_type) {
       $auth_types[$row->auth_category][$row->biblio_type][] = $row->auth_type;
     }
   }
-  $result = isset($auth_types[$auth_category][$biblio_type])?$auth_types[$auth_category][$biblio_type]:null;
-  // fall back to defaults, if no author types are defined for this biblio_type
+  $result = isset($auth_types[$auth_category][$biblio_type])
+            ? $auth_types[$auth_category][$biblio_type]
+            : NULL;
+  // Fall back to defaults if no author types are defined for this biblio_type.
   if (empty($result)) $result = $auth_types[$auth_category][0];
   return $result;
 }
+
+/**
+ * Retrieves primary author type based on author category and biblio type.
+ *
+ * @param string $auth_category
+ *   A string representing the category of author.
+ * @param string $biblio_type
+ *   A string representing the type of biblio item.
+ *
+ * @return string|null
+ *   A string with the primary author type. NULL is returned if no matches could
+ *   be found.
+ */
 function _biblio_get_auth_type($auth_category, $biblio_type) {
-  $result = (array)_biblio_get_auth_types($auth_category, $biblio_type);
-  // return first element of the array
+  $result = (array) _biblio_get_auth_types($auth_category, $biblio_type);
+  // Return first element of the author types array.
   return empty($result) ? NULL : current($result);
 }
+
+/**
+ * Retrieves field information based upon bibilio type.
+ *
+ * @param string $biblio_type
+ *   The type of biblio to retrieve field information about.
+ * @param bool $only_visible
+ *   (optional) A logical flag indicating whether to only return visible fields.
+ *   The default is FALSE which indicates information on all fields for this
+ *   biblio_type should be returned.
+ *
+ * @return array
+ *   An associative array keyed integer of field ID.
+ */
 function _biblio_get_field_information($biblio_type, $only_visible = FALSE) {
   $fields = array();
   $visible = $only_visible ? ' AND (bt.common = 1 OR bt.visible=1) ' : '';
@@ -57,8 +98,16 @@ function _biblio_get_field_information($biblio_type, $only_visible = FALSE) {
 }
 
 /**
- * Translate field titles and hints through the interface translation system, if
- * the i18nstrings module is enabled.
+ * Translates interface field titles and hints.
+ *
+ * If the i18nstrings module is enabled, this function translates field titles
+ * and hints through the interface translation system.
+ *
+ * @param array $fields
+ *   An associative array with field information passed by reference keyed by
+ *   field ID number with two elements:
+ *   - title: A string with the title of the field.
+ *   - hint: A string with the hint text for the field.
  */
 function _biblio_localize_fields(&$fields) {
   if (module_exists('i18nstrings')) {
@@ -70,19 +119,20 @@ function _biblio_localize_fields(&$fields) {
 }
 
 /**
- * Translate a publication type through the interface translation system, if
- * the i18nstrings module is enabled.
+ * Translates a publication type for the interface.
+ *
+ * If the i18nstrings module is enabled, this function translates a publication
+ * type through the interface translation system.
  *
  * @param integer $tid
  *   The biblio publication type identifier.
- *
  * @param string $value
  *   The string to translate.
- *
  * @param string $field
- *   The publication type field to translate (either 'name' or 'description').
+ *   (optional) The publication type field to translate (either 'name' or
+ *   'description'). The default value is 'name'.
  *
- * @return
+ * @return string
  *   Translated value.
  */
 function _biblio_localize_type($tid, $value, $field = 'name') {
@@ -93,7 +143,7 @@ function _biblio_localize_type($tid, $value, $field = 'name') {
 }
 
 /**
- * Implementation of hook_locale().
+ * Implements hook_locale().
  */
 function biblio_locale($op = 'groups', $group = NULL) {
   switch ($op) {
@@ -110,11 +160,12 @@ function biblio_locale($op = 'groups', $group = NULL) {
 }
 
 /**
- * Refresh all translatable field strings.
+ * Refreshes all translatable field strings.
  *
  * @param integer $tid
- *   Biblio publication type id whose field strings are to be refreshed. If not
- *   specified, strings for all fields will be refreshed.
+ *   (optional) Biblio publication type ID whose field strings are to be
+ *   refreshed. If not specified, strings for all fields will be refreshed. The
+ *   default value is NULL.
  */
 function biblio_locale_refresh_fields($tid = NULL) {
   if (module_exists('i18nstrings')) {
@@ -132,11 +183,12 @@ function biblio_locale_refresh_fields($tid = NULL) {
 }
 
 /**
- * Refresh all publication type strings.
+ * Refreshes all publication type strings.
  *
  * @param integer $tid
- *   Biblio publication type id whose field strings are to be refreshed. If not
- *   specified, strings for all fields will be refreshed.
+ *   (optional) Biblio publication type ID whose field strings are to be
+ *   refreshed. If not specified, strings for all fields will be refreshed. The
+ *   default value is NULL.
  */
 function biblio_locale_refresh_types($tid = NULL) {
   if (module_exists('i18nstrings')) {
@@ -153,11 +205,16 @@ function biblio_locale_refresh_types($tid = NULL) {
   }
 }
 
+/**
+ * Implements hook_init().
+ */
 function biblio_init() {
   global $user, $conf;
   drupal_add_css(drupal_get_path('module', 'biblio') .'/biblio.css');
 
-  if ($user->uid === 0) { // Prevent caching of biblio pages for anonymous users so session variables work and thus filering works
+  // Prevent caching of biblio pages for anonymous users so session variables
+  // work and hence filering also works.
+  if ($user->uid === 0) {
     $base = variable_get('biblio_base', 'biblio');
     if (drupal_match_path($_GET['q'], "$base\n$base/*"))
       $conf['cache'] = FALSE;
@@ -165,8 +222,8 @@ function biblio_init() {
 }
 
 function biblio_cron() {
-  require_once(drupal_get_path('module', 'biblio') .'/includes/biblio.contributors.inc');
-  require_once(drupal_get_path('module', 'biblio') .'/includes/biblio.keywords.inc');
+  require_once(drupal_get_path('module', 'biblio') .'/includes/biblio.contributors.inc');
+  require_once(drupal_get_path('module', 'biblio') .'/includes/biblio.keywords.inc');
 
   $interval = variable_get('biblio_orphan_clean_interval', 24*60*60); //defaults to once per day
 
@@ -783,7 +840,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
@@ -868,7 +925,7 @@ function biblio_menu() {
     'access callback'   => 'biblio_access',
     'access arguments'  => array('edit_author'),
     'file'              => 'includes/biblio.admin.inc',
-   	'type'              => MENU_CALLBACK,
+    'type'              => MENU_CALLBACK,
     'weight'            => -6
   );
   $items['admin/settings/biblio/author/orphans'] = array(
diff --git a/includes/biblio_theme.inc b/includes/biblio_theme.inc
index 327d5b7..421c9b4 100644
--- a/includes/biblio_theme.inc
+++ b/includes/biblio_theme.inc
@@ -606,12 +606,23 @@ 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
+ */
 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 = $inline ? "/inline" : "";
+  $inline = isset($inline) ? "/inline" : "";
   $language = isset($node->language) ? $node->language : '';
 
   if (isset($_GET['sort'])) {
@@ -625,11 +636,11 @@ function theme_biblio_author_link($author) {
   if (isset($author['drupal_uid']) && $author['drupal_uid'] > 0) {
     $options['attributes']['class'] = 'biblio-local-author';
   }
-  if (variable_get('biblio_links_target_new_window', null)){
-    $options = array_merge($options, array('attributes' => array('target'=>'_blank'), 'html' => TRUE));
+  if (variable_get('biblio_links_target_new_window', NULL)){
+    $options = array_merge($options, array('attributes' => array('target' => '_blank'), 'html' => TRUE));
   }
 
-  if ($link_to_profile && $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);
@@ -637,7 +648,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'] .$inline, $options );
+    return l(trim($author['name']), "$base/author/" . $author['cid'] . $inline, $options);
   }
   return $html;
 }
