diff --git a/autologout.module b/autologout.module
index 75bea1a..eb5a773 100644
--- a/autologout.module
+++ b/autologout.module
@@ -187,7 +187,7 @@ function autologout_init() {
   global $user;
 
   // If user is not anonymous and they should be autologged out.
-  if ($user->uid && _autologout_logout_role($user)) {
+  if ($user->uid && (_autologout_logout_role($user) || variable_get('autologout_timeout', '1800'))) {
     // Should we be enforcing on admin pages?
     // Check to see if autologout on admin pages is enforeced.
     if (arg(0) == 'admin' && !variable_get('autologout_enforce_admin', FALSE)) {
@@ -249,7 +249,7 @@ function autologout_ahah_set_last() {
  * 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);
+  $default_timeout = variable_get('autologout_timeout', '1800');
   $roles = user_roles(TRUE);
 
   // Go through roles, get timeouts for each and return as array.
@@ -275,7 +275,7 @@ function _autologout_get_user_timeout() {
     $userid = '';
   }
 
-  $default_timeout = variable_get('autologout_timeout', 1800);
+  $default_timeout = variable_get('autologout_timeout', '1800');
 
   // If no individual timeout is set.
   if (!variable_get('autologout_user_' . $userid, $default_timeout)) {
@@ -333,9 +333,11 @@ function _autologout_logout() {
  * Helper to determine if a given user should be autologged out.
  */
 function _autologout_logout_role($user) {
-  foreach ($user->roles as $key => $role) {
-    if (variable_get('autologout_role_' . $key, FALSE)) {
-      return TRUE;
+  if (variable_get('autologout_role_logout', 0)) {
+    foreach ($user->roles as $key => $role) {
+      if (variable_get('autologout_role_' . $key, FALSE)) {
+        return TRUE;
+      }
     }
   }
 
