diff --git a/autologout.module b/autologout.module
index a7b79c0..1f17042 100644
--- a/autologout.module
+++ b/autologout.module
@@ -188,7 +188,7 @@ function autologout_user_profile_submit(&$form, &$form_state) {
  */
 function autologout_init() {
   global $user;
-  if ($user->uid && _autologout_logout_role($user)) { // if user is not anonymous and they should be autologged out
+  if ($user->uid && (_autologout_logout_role($user) || variable_get('autologout_timeout', '1800'))) { // if user is not anonymous and they should be autologged out
     // should we be enforcing on admin pages?
     if (arg(0) == 'admin' && !variable_get('autologout_enforce_admin', FALSE)) { //Check to see if autologout on admin pages is enforeced
       return;
@@ -256,7 +256,7 @@ function autologout_ahah_set_last() {
  */
 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,
@@ -280,7 +280,7 @@ function _autologout_get_user_timeout() {
       $userid = ''; //
     }
 
-  $default_timeout = variable_get('autologout_timeout', 1800);
+  $default_timeout = variable_get('autologout_timeout', '1800');
 
     if (!variable_get('autologout_user_' . $userid, $default_timeout)) { // If no individual timeout is set
       if (variable_get('autologout_role_logout', FALSE)) { //Get role timeouts for user
@@ -335,9 +335,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;
+      }
     }
   }
 
