=== modified file 'autologout/autologout.module'
--- autologout/autologout.module	2012-10-29 11:15:53 +0000
+++ autologout/autologout.module	2012-10-29 12:27:37 +0000
@@ -130,7 +130,7 @@
  * Adds a field to user/edit to change that users logout.
  */
 function autologout_form_user_profile_form_alter(&$form, $form_state) {
-  if (variable_get('autologout_allow_individual_user_timeouts', FALSE) {
+  if (variable_get('autologout_allow_individual_user_timeouts', FALSE)) {
     $user_timeout = _autologout_get_user_timeout();
     global $user;
     $current_uid = $user -> uid; //Get UID of user that is accessing page
@@ -259,14 +259,13 @@
  * Go through every role to get timeout value, default is the global timeout.
  */
 function _autologout_get_role_timeout() {
-
- $default_timeout = variable_get('autologout_timeout', 1800);
  $roles = user_roles(TRUE);
 
 //Go through roles, get timeouts for each and return as array, 
  foreach ($roles as $rid => $role) {
-   $timeout_role = variable_get('autologout_role_' . $rid . '_timeout', $default_timeout);
-   $role_timeout[$rid] = $timeout_role;
+   if ($timeout_role = variable_get('autologout_role_' . $rid . '_timeout', FALSE)) {
+     $role_timeout[$rid] = $timeout_role;
+   }
  }
   return $role_timeout;
 }
@@ -291,16 +290,20 @@
       $roles = $user -> roles;
       $output = array();
       $timeouts = _autologout_get_role_timeout();
-        foreach ($roles as $rid => $role) {
-          $output[$rid] =  $timeouts[$rid];
+      foreach ($roles as $rid => $role) {
+        if (!empty($timeouts[$rid])) {
+          $output[$rid] = $timeouts[$rid];
         }
-      $user_timeout = min($output);  // Assign the lowest timeout value to be session timeout value
-     }
-     else{
+      }
+      if (!empty($output)) {
+        $user_timeout = min($output);  // Assign the lowest timeout value to be session timeout value
+      }
+    }
+    else {
       $user_timeout = $default_timeout; 
     }
   }
-  else{
+  else {
     $user_timeout = variable_get('autologout_user_' . $userid, $default_timeout); 
   }

