diff -r 0f439c53f704 wp-includes/ms-settings.php
--- a/wp-includes/ms-settings.php	Sat Jun 02 16:57:10 2012 +0000
+++ b/wp-includes/ms-settings.php	Mon Jun 04 11:57:53 2012 +0000
@@ -115,7 +115,8 @@
 
 	if ( ! $blog_id ) {
 		if ( defined( 'WP_INSTALLING' ) ) {
-			$current_blog->blog_id = $blog_id = 1;
+			// in multisite, the main blog may not be always the first one!!
+			$current_blog->blog_id = $blog_id = ( defined('BLOG_ID_CURRENT_SITE') ? BLOG_ID_CURRENT_SITE : 1 ) ;
 		} else {
 			wp_load_translations_early();
 			$msg = ! $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->site'" ) ? ' ' . __( 'Database tables are missing.' ) : '';
