diff --git a/og_access_roles.module b/og_access_roles.module
index 23afee5..2165768 100644
--- a/og_access_roles.module
+++ b/og_access_roles.module
@@ -13,27 +13,27 @@
 /**
  * Group access roles field.
  */
-define('OG_ACCESS_GROUP_ROLES_FIELD', 'group_access_roles');
+define('OG_ACCESS_ROLES_GROUP_ROLES_FIELD', 'group_access_roles');
 
 /**
  * Group content access roles field.
  */
-define('OG_ACCESS_GROUP_CONTENT_ROLES_FIELD', 'group_content_access_roles');
+define('OG_ACCESS_ROLES_GROUP_CONTENT_ROLES_FIELD', 'group_content_access_roles');
 
 /**
- * Implement hook_og_fields_info().
+ * Implements hook_og_fields_info().
  */
 function og_access_roles_og_fields_info() {
   $roles = user_roles();
 
   // Add a field for role based permissions for group nodes.
-  $items[OG_ACCESS_GROUP_ROLES_FIELD] = array(
+  $items[OG_ACCESS_ROLES_GROUP_ROLES_FIELD] = array(
     'type' => array('group'),
     'description' => t('Determine which site-wide user roles have access to a private group.'),
     // Private access can be done only on node entity.
     'entity' => array('node'),
     'field' => array(
-      'field_name' => OG_ACCESS_GROUP_ROLES_FIELD,
+      'field_name' => OG_ACCESS_ROLES_GROUP_ROLES_FIELD,
       'no_ui' => TRUE,
       'type' => 'list_integer',
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
@@ -61,13 +61,13 @@ function og_access_roles_og_fields_info() {
   );
 
   // Add a field for role based permissions for group content nodes.
-  $items[OG_ACCESS_GROUP_CONTENT_ROLES_FIELD] = array(
+  $items[OG_ACCESS_ROLES_GROUP_CONTENT_ROLES_FIELD] = array(
     'type' => array('group content'),
     'description' => t('Determine which site-wide user roles have access to private group content.'),
     // Private access can be done only on node entity.
     'entity' => array('node'),
     'field' => array(
-      'field_name' => OG_ACCESS_GROUP_CONTENT_ROLES_FIELD,
+      'field_name' => OG_ACCESS_ROLES_GROUP_CONTENT_ROLES_FIELD,
       'no_ui' => TRUE,
       'type' => 'list_integer',
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
@@ -100,82 +100,87 @@ function og_access_roles_og_fields_info() {
 /**
  * Implements hook_node_access_records().
  *
- * @see og_access_roles_node_grants().
+ * @see og_access_roles_node_grants()
  */
 function og_access_roles_node_access_records($node) {
   $grants = array();
-  $private = FALSE;
-  $roles = array();
 
   // Don't grant access to any unpublished nodes.
-  if (!empty($node->status)) {
-    $node_wrapper = entity_metadata_wrapper('node', $node);
-
-    // If the node is a group node.
-    if (og_is_group_type('node', $node->type)) {
-      // If the group is private.
-      if (!empty($node_wrapper->{OG_ACCESS_FIELD}) && $node_wrapper->{OG_ACCESS_FIELD}->value()) {
-        $private = TRUE;
-        // If group access roles are set for this node add them to our list of
-        // allowed roles.
-        if (!empty($node_wrapper->{OG_ACCESS_GROUP_ROLES_FIELD})) {
-          $roles += $node_wrapper->{OG_ACCESS_GROUP_ROLES_FIELD}->value();
-        }
+  if (!$node->status) {
+    return $grants;
+  }
+
+  $private = FALSE;
+  $roles = array();
+  $node_wrapper = entity_metadata_wrapper('node', $node);
+
+  // If the node is a group node.
+  if (og_is_group_type('node', $node->type)) {
+    // If the group is private.
+    if (!empty($node_wrapper->{OG_ACCESS_FIELD}) && $node_wrapper->{OG_ACCESS_FIELD}->value()) {
+      $private = TRUE;
+      // If group access roles are set for this node add them to our list of
+      // allowed roles.
+      if (!empty($node_wrapper->{OG_ACCESS_ROLES_GROUP_ROLES_FIELD})) {
+        $roles += $node_wrapper->{OG_ACCESS_ROLES_GROUP_ROLES_FIELD}->value();
       }
     }
+  }
 
-    // If the node is a group content node.
-    // It's possible that a node could be both a group and content of another
-    // group and could have role based access for each in which case we use
-    // roles from either fields.
-    if (og_is_group_content_type('node', $node->type)) {
-      // Get content access setting for the group content node.
-      $content_access = !empty($node_wrapper->{OG_CONTENT_ACCESS_FIELD}) ? $node_wrapper->{OG_CONTENT_ACCESS_FIELD}->value() : OG_CONTENT_ACCESS_DEFAULT;
-
-      // If the content is private.
-      if ($content_access == OG_CONTENT_ACCESS_PRIVATE) {
-        $private = TRUE;
-        // If group access roles are set for this node add them to our list of
-        // allowed roles.
-        if (!empty($node_wrapper->{OG_ACCESS_GROUP_CONTENT_ROLES_FIELD})) {
-          $roles += $node_wrapper->{OG_ACCESS_GROUP_CONTENT_ROLES_FIELD}->value();
-        }
+  // If the node is a group content node.
+  // It's possible that a node could be both a group and content of another
+  // group and could have role based access for each in which case we use
+  // roles from either fields.
+  if (og_is_group_content_type('node', $node->type)) {
+    // Get content access setting for the group content node.
+    $content_access = !empty($node_wrapper->{OG_CONTENT_ACCESS_FIELD}) ? $node_wrapper->{OG_CONTENT_ACCESS_FIELD}->value() : OG_CONTENT_ACCESS_DEFAULT;
+
+    // If the content is private.
+    if ($content_access == OG_CONTENT_ACCESS_PRIVATE) {
+      $private = TRUE;
+      // If group access roles are set for this node add them to our list of
+      // allowed roles.
+      if (!empty($node_wrapper->{OG_ACCESS_ROLES_GROUP_CONTENT_ROLES_FIELD})) {
+        $roles += $node_wrapper->{OG_ACCESS_ROLES_GROUP_CONTENT_ROLES_FIELD}->value();
       }
-      // If the content is set to use the parent group's access config.
-      elseif ($content_access == OG_CONTENT_ACCESS_DEFAULT) {
-        // Get the parent groups for this node.
-        if ($entity_groups = og_get_entity_groups('node', $node)) {
-          foreach ($entity_groups as $group_type => $values) {
-            foreach ($values as $group_nid) {
-              $group_wrapper = entity_metadata_wrapper($group_type, $group_nid);
-              // If the group is private.
-              if (!empty($group_wrapper->{OG_ACCESS_FIELD}) && $group_wrapper->{OG_ACCESS_FIELD}->value()) {
-                $private = TRUE;
-                // If group access roles are set for this group add them to our
-                // list of allowed roles.
-                if (!empty($group_wrapper->{OG_ACCESS_GROUP_ROLES_FIELD})) {
-                  $roles += $group_wrapper->{OG_ACCESS_GROUP_ROLES_FIELD}->value();
-                }
+    }
+    // If the content is set to use the parent group's access config.
+    elseif ($content_access == OG_CONTENT_ACCESS_DEFAULT) {
+      // Get the parent groups for this node.
+      if ($entity_groups = og_get_entity_groups('node', $node)) {
+        foreach ($entity_groups as $group_type => $values) {
+          foreach ($values as $group_nid) {
+            $group_wrapper = entity_metadata_wrapper($group_type, $group_nid);
+            // If the group is private.
+            if (!empty($group_wrapper->{OG_ACCESS_FIELD}) && $group_wrapper->{OG_ACCESS_FIELD}->value()) {
+              $private = TRUE;
+              if (!empty($node_wrapper->{OG_ACCESS_ROLES_GROUP_CONTENT_ROLES_FIELD})) {
+                $roles += $node_wrapper->{OG_ACCESS_ROLES_GROUP_CONTENT_ROLES_FIELD}->value();
+              }
+              // If group access roles are set for this group add them to our
+              // list of allowed roles.
+              elseif (!empty($group_wrapper->{OG_ACCESS_ROLES_GROUP_ROLES_FIELD})) {
+                $roles += $group_wrapper->{OG_ACCESS_ROLES_GROUP_ROLES_FIELD}->value();
               }
             }
           }
         }
       }
     }
+  }
 
-    // If the node is a private group or private group content and roles have
-    // been set for og access roles then set the appropriate grants.
-    if ($private && $roles) {
-      foreach ($roles as $rid) {
-        $grants[] = array (
-          'realm' => OG_ACCESS_ROLES_REALM,
-          'gid' => $rid,
-          'grant_view' => 1,
-          'grant_update' => 0,
-          'grant_delete' => 0,
-          'priority' => 0,
-        );
-      }
+  // If the node is a private group or private group content and roles have
+  // been set for og access roles then set the appropriate grants.
+  if ($private && $roles) {
+    foreach ($roles as $rid) {
+      $grants[] = array(
+        'realm' => OG_ACCESS_ROLES_REALM,
+        'gid' => $rid,
+        'grant_view' => 1,
+        'grant_update' => 0,
+        'grant_delete' => 0,
+        'priority' => 0,
+      );
     }
   }
 
@@ -185,7 +190,7 @@ function og_access_roles_node_access_records($node) {
 /**
  * Implements hook_node_grants().
  *
- * @see og_access_roles_node_access_records().
+ * @see og_access_roles_node_access_records()
  */
 function og_access_roles_node_grants($account, $op) {
   $grants = array();
@@ -209,15 +214,17 @@ function og_access_roles_node_grants($account, $op) {
  */
 function og_access_roles_node_access_explain($row) {
   // Only process our own access grants.
-  if ($row->realm == OG_ACCESS_ROLES_REALM) {
-    // This module only deals with view grants so if the row has grant_view then
-    // return info, otherwise we have no grants.
-    if ($row->grant_view) {
-      $role = user_role_load($row->gid);
-      return t('Role %role-name may view this node.', array('%role-name' => $role->name));
-    }
-    else {
-      return t('No access.');
-    }
+  if ($row->realm != OG_ACCESS_ROLES_REALM) {
+    return '';
+  }
+
+  // This module only deals with view grants so if the row has grant_view then
+  // return info, otherwise we have no grants.
+  if ($row->grant_view) {
+    $role = user_role_load($row->gid);
+    return t('Role %role-name may view this node.', array('%role-name' => $role->name));
+  }
+  else {
+    return t('No access.');
   }
 }
