diff -urpN drupal-6.x-dev-200705302348/includes/menu.inc drupal-6.x-dev/includes/menu.inc
--- drupal-6.x-dev-200705302348/includes/menu.inc	2007-05-30 23:26:33.000000000 +0800
+++ drupal-6.x-dev/includes/menu.inc	2007-05-31 00:55:06.000000000 +0800
@@ -925,7 +925,7 @@ function menu_local_tasks($level = 0) {
       return array();
     }
     // Get all tabs
-    $result = db_query("SELECT * FROM {menu_router} WHERE tab_root = '%s' AND tab_parent != '' ORDER BY weight, title", $router_item['tab_root']);
+    $result = db_query("SELECT * FROM {menu_router} WHERE tab_root = '%s' AND tab_parent IS NOT NULL ORDER BY weight, title", $router_item['tab_root']);
     $map = arg();
     $children = array();
     $tab_parent = array();
diff -urpN drupal-6.x-dev-200705302348/modules/block/block.module drupal-6.x-dev/modules/block/block.module
--- drupal-6.x-dev-200705302348/modules/block/block.module	2007-05-28 14:08:39.000000000 +0800
+++ drupal-6.x-dev/modules/block/block.module	2007-05-31 00:09:20.000000000 +0800
@@ -295,7 +295,7 @@ function _block_compare($a, $b) {
 function block_admin_display_submit($form, &$form_state, $form_values) {
   foreach ($form_values as $block) {
     $block['status'] = $block['region'] != BLOCK_REGION_NONE;
-    $block['region'] = $block['status'] ? $block['region'] : '';
+    $block['region'] = $block['status'] ? $block['region'] : 'left';
     db_query("UPDATE {blocks} SET status = %d, weight = %d, region = '%s', throttle = %d WHERE module = '%s' AND delta = '%s' AND theme = '%s'", $block['status'], $block['weight'], $block['region'], isset($block['throttle']) ? $block['throttle'] : 0, $block['module'], $block['delta'], $block['theme']);
   }
   drupal_set_message(t('The block settings have been updated.'));
diff -urpN drupal-6.x-dev-200705302348/modules/user/user.module drupal-6.x-dev/modules/user/user.module
--- drupal-6.x-dev-200705302348/modules/user/user.module	2007-05-30 16:08:59.000000000 +0800
+++ drupal-6.x-dev/modules/user/user.module	2007-05-31 00:51:32.000000000 +0800
@@ -386,7 +386,7 @@ function user_access($string, $account =
   global $user;
   static $perm = array();
 
-  if (is_null($account)) {
+  if (is_null($account) || !isset($account->uid)) {
     $account = $user;
   }
 
@@ -1156,6 +1156,9 @@ function user_logout() {
   // Load the anonymous user
   $user = drupal_anonymous_user();
 
+  // Unlock all locked tables, and commit current transaction.
+  db_unlock_tables();
+
   drupal_goto();
 }
 
