diff --git a/mongodb_block/mongodb_block.module b/mongodb_block/mongodb_block.module
index b0dba3b..fb6a2aa 100644
--- a/mongodb_block/mongodb_block.module
+++ b/mongodb_block/mongodb_block.module
@@ -7,11 +7,11 @@
  * Resembles very closely the core block module but without an UI.
  */
 
-if (!defined('BLOCK_REGION_NONE')) {
+if (!defined('MONGO_BLOCK_REGION_NONE')) {
   /**
   * Denotes that a block is not enabled in any region and should not be shown.
   */
-  define('BLOCK_REGION_NONE', -1);
+  define('MONGO_BLOCK_REGION_NONE', -1);
 }
 
 /**
@@ -237,7 +237,7 @@ function _mongodb_block_rehash($theme) {
           'pages' => array('%'),
           'pages_exclude' => array(),
           'status' => 0,
-          'region' => BLOCK_REGION_NONE,
+          'region' => MONGO_BLOCK_REGION_NONE,
         );
         if (isset($block['node_type'])) {
           $block['pages'] = array('node/%');
@@ -252,9 +252,9 @@ function _mongodb_block_rehash($theme) {
   drupal_alter('mongodb_block_info', $blocks, $theme);
   // Only store the block in the mongodb, if the status is enabled.
   foreach ($blocks as $key => $block) {
-    if ($block['region'] != BLOCK_REGION_NONE && !isset($regions[$block['region']])) {
+    if ($block['region'] != MONGO_BLOCK_REGION_NONE && !isset($regions[$block['region']])) {
       $blocks[$key]['status'] = 0;
-      $blocks[$key]['region'] = BLOCK_REGION_NONE;
+      $blocks[$key]['region'] = MONGO_BLOCK_REGION_NONE;
       $block = $blocks[$key];
     }
     if ($block['status']) {
@@ -288,7 +288,7 @@ function mongodb_block_save_block($collection, $block) {
  *
  * @see block.tpl.php
  */
-function template_preprocess_block(&$variables) {
+function template_preprocess_mongodb_block(&$variables) {
   $block_counter = &drupal_static(__FUNCTION__, array());
   $variables['block'] = $variables['elements']['#block'];
   // All blocks get an independent counter for each region.
diff --git a/mongodb_block_ui/mongodb_block_ui.admin.inc b/mongodb_block_ui/mongodb_block_ui.admin.inc
index ab38bd0..5a62cfc 100644
--- a/mongodb_block_ui/mongodb_block_ui.admin.inc
+++ b/mongodb_block_ui/mongodb_block_ui.admin.inc
@@ -53,7 +53,7 @@ function mongodb_block_ui_admin_display_form($form, &$form_state, $blocks, $them
 
   drupal_add_css(drupal_get_path('module', 'mongodb_block_ui') . '/mongodb_block_ui.css', array('preprocess' => FALSE));
 
-  $blocks_regions = system_region_list($theme, REGIONS_VISIBLE) + array(BLOCK_REGION_NONE => '<' . t('none') . '>');
+  $blocks_regions = system_region_list($theme, REGIONS_VISIBLE) + array(MONGO_BLOCK_REGION_NONE => '<' . t('none') . '>');
 
   // Weights range from -delta to +delta, so delta should be at least half
   // of the amount of mongodb_block_uis present. This makes sure all mongodb_block_uis in the same
@@ -109,7 +109,7 @@ function mongodb_block_ui_admin_display_form($form, &$form_state, $blocks, $them
     }
   }
   // Do not allow disabling the main system content mongodb_block_ui.
-  unset($form['system_main']['region']['#options'][BLOCK_REGION_NONE]);
+  unset($form['system_main']['region']['#options'][MONGO_BLOCK_REGION_NONE]);
 
   $form['actions'] = array(
     '#tree' => FALSE,
@@ -171,7 +171,7 @@ function _mongodb_block_ui_compare($a, $b) {
   // We need the region list to correctly order by region.
   if (!isset($regions)) {
     $regions = array_flip(array_keys(system_region_list($theme)));
-    $regions[BLOCK_REGION_NONE] = count($regions);
+    $regions[MONGO_BLOCK_REGION_NONE] = count($regions);
   }
 
   // Separate enabled from disabled.
@@ -252,8 +252,8 @@ function mongodb_block_ui_admin_configure($form, &$form_state, $theme, $module,
        $form['regions'][$key] = array(
          '#type' => 'select',
          '#title' => $theme->info['name'],
-         '#default_value' => (!empty($region) ? $region : BLOCK_REGION_NONE),
-         '#options' => array(BLOCK_REGION_NONE => t('<none>')) + system_region_list($key, REGIONS_VISIBLE),
+         '#default_value' => (!empty($region) ? $region : MONGO_BLOCK_REGION_NONE),
+         '#options' => array(MONGO_BLOCK_REGION_NONE => t('<none>')) + system_region_list($key, REGIONS_VISIBLE),
          '#expandable' => ($key !== $theme_default),
          '#weight' => ($key == $theme_default ? 9 : 10),
        );
@@ -506,7 +506,7 @@ function mongodb_block_ui_custom_block_delete_submit($form, &$form_state) {
 function template_preprocess_mongodb_block_ui_admin_display_form(&$variables) {
 
   $block_regions = system_region_list($variables['form']['edited_theme']['#value'], REGIONS_VISIBLE);
-  $variables['block_regions'] = $block_regions + array(BLOCK_REGION_NONE => t('Disabled'));
+  $variables['block_regions'] = $block_regions + array(MONGO_BLOCK_REGION_NONE => t('Disabled'));
 
   foreach ($block_regions as $key => $value) {
     // Initialize an empty array for the region.
@@ -514,7 +514,7 @@ function template_preprocess_mongodb_block_ui_admin_display_form(&$variables) {
   }
 
   // Initialize disabled mongodb_block_uis array.
-  $variables['block_listing'][BLOCK_REGION_NONE] = array();
+  $variables['block_listing'][MONGO_BLOCK_REGION_NONE] = array();
 
   // Set up to track previous region in loop.
   $last_region = '';
diff --git a/mongodb_block_ui/mongodb_block_ui.module b/mongodb_block_ui/mongodb_block_ui.module
index 174def0..96bfe52 100644
--- a/mongodb_block_ui/mongodb_block_ui.module
+++ b/mongodb_block_ui/mongodb_block_ui.module
@@ -191,7 +191,7 @@ function mongodb_block_ui_mongodb_block_info_alter(&$blocks, $theme) {
   foreach (mongodb_collection('block_customized', $theme)->find() as $block) {
     $index = $block['_id']['module'] . '_' . $block['_id']['delta'];
     unset($block['_id']);
-    if (isset($block['region']) && $block['region'] != BLOCK_REGION_NONE) {
+    if (isset($block['region']) && $block['region'] != MONGO_BLOCK_REGION_NONE) {
       $block['status'] = TRUE;
     }
     $blocks[$index] = $block + $blocks[$index];
diff --git a/mongodb_session/mongodb_session.inc b/mongodb_session/mongodb_session.inc
index b574982..05e08f2 100644
--- a/mongodb_session/mongodb_session.inc
+++ b/mongodb_session/mongodb_session.inc
@@ -105,7 +105,7 @@ function _drupal_session_read($sid) {
 
   // We found the client's session record and they are an authenticated,
   // active user.
-  if ($session && !empty($session['uid']) && $session['status'] == 1) {
+  if ($session && !empty($session['uid'])) {
     $collection = mongodb_collection('fields_current', 'user');
     $user = (object) $collection->findOne(array('_id' => $session['uid']));
     // Copy from SQL.
