diff --git a/README.txt b/README.txt
index efdfd67..5910af6 100644
--- a/README.txt
+++ b/README.txt
@@ -57,7 +57,9 @@ To install:
 - Go to Administer >> Modules >> List and enable the Facebook
   modules.
 
-  Enable fb.module for Social Plugins.
+  
+  For Social Plugins enable fb fb_app and fb_connect modules. You'll
+  need to complete fb_app module data and select a default app for the fb_connect module.
 
   Enable fb_devel.module and keep it enabled until you have everything
   set up. You should disable this on your live server once you are
diff --git a/fb.js b/fb.js
index ae784de..eb27a62 100644
--- a/fb.js
+++ b/fb.js
@@ -7,6 +7,7 @@ window.fbAsyncInit = function() {
     debugger; // this should not be reached.
   }
   FB.init(Drupal.settings.fb.fb_init_settings);
+  fbApiInit = true;
 
   FB.XFBML.parse();
 
@@ -252,7 +253,8 @@ FB_JS.sessionSanityCheck = function() {
 
       // Once upon a time, we initialized facebook's JS SDK here.  But now that is done in fb_footer().
 
-      if (typeof(FB) != 'undefined') {
+      if (window.fbApiInit) {
+//      if (typeof(FB) != 'undefined') {
         // Render any XFBML markup that may have been added by AJAX.
         $(context).each(function() {
           var elem = $(this).get(0);
diff --git a/fb_connect.module b/fb_connect.module
index 27dbabb..5b87870 100644
--- a/fb_connect.module
+++ b/fb_connect.module
@@ -143,14 +143,23 @@ function _fb_connect_add_js($fb_app, $fb) {
       // there is no "primary" app.
       // @TODO fb.module should have a helper to make this cleaner.
 
+      $settings['fb_init_settings']['appId'] = $fb_app->id;
       $settings['fb_init_settings']['apiKey'] = $fb_app->apikey;
       $settings['fb_init_settings']['session'] = $fb->getSession();
+      fb_js_settings('appId', $fb_app->id);
       fb_js_settings('apikey', $fb_app->apikey);
       fb_js_settings('fbu', fb_facebook_user($fb));
       fb_js_settings('fb_init_settings', $settings['fb_init_settings']);
       //$js = drupal_add_js(array('fb' => fb_js_settings()), 'setting');
       // fb.module will add settings to footer.
     }
+    if (!isset($settings['fb_init_settings']['appId']) ||
+        $settings['fb_init_settings']['appId'] != $fb_app->id) {
+      $settings['fb_init_settings']['appId'] = $fb_app->id;
+      fb_js_settings('appId', $fb_app->id);
+      fb_js_settings('fb_init_settings', $settings['fb_init_settings']);
+    }
+
   }
 
 }
