Index: bp-activity/bp-activity-templatetags.php
===================================================================
--- bp-activity/bp-activity-templatetags.php	(revision 1595)
+++ bp-activity/bp-activity-templatetags.php	(working copy)
@@ -307,8 +307,9 @@
 		
 		if ( !$component_names )
 			return false;
-		
-		$link = remove_query_arg( array( 'afilter' ), $_SERVER['REQUEST_URI'] );
+
+		$link = $_SERVER['REQUEST_URI'];
+		$link = remove_query_arg( array( 'afilter' ), $link );
 		$link = remove_query_arg( array( 'acpage' ), $link );
 
 		foreach ( (array) $component_names as $component_name ) {
Index: bp-blogs/bp-blogs-templatetags.php
===================================================================
--- bp-blogs/bp-blogs-templatetags.php	(revision 1595)
+++ bp-blogs/bp-blogs-templatetags.php	(working copy)
@@ -788,7 +788,7 @@
 		return false;
 
 	foreach ( $terms as $term ) {
-		$link = get_blog_option( 1, 'siteurl') . '/tag/' . $term->slug;
+		$link = get_blog_option( BP_ROOT_BLOG, 'siteurl') . '/tag/' . $term->slug;
 		$link = apply_filters('term_link', $link);
 		
 		$term_links[] = '<a href="' . $link . '" rel="tag">' . $term->name . '</a>';
Index: bp-core.php
===================================================================
--- bp-core.php	(revision 1595)
+++ bp-core.php	(working copy)
@@ -1333,7 +1333,7 @@
  * @return The blog name for the root blog
  */
 function bp_core_email_from_name_filter() {
-	return get_blog_option( 1, 'blogname' );
+	return get_blog_option( BP_ROOT_BLOG, 'blogname' );
 }
 add_filter( 'wp_mail_from_name', 'bp_core_email_from_name_filter' );
 
Index: bp-core/bp-core-avatars.php
===================================================================
--- bp-core/bp-core-avatars.php	(revision 1595)
+++ bp-core/bp-core-avatars.php	(working copy)
@@ -233,7 +233,7 @@
 	if ( !$user_id )
 		$user_id = $bp->loggedin_user->id;
 
-	$path  = get_blog_option( 1, 'upload_path' );
+	$path  = get_blog_option( BP_ROOT_BLOG, 'upload_path' );
 	$newdir = path_join( ABSPATH, $path );
 	$newdir .= '/avatars/' . $user_id;
 
@@ -241,7 +241,7 @@
 	
 	@wp_mkdir_p( $newdir );
 
-	$newurl = trailingslashit( get_blog_option( 1, 'siteurl' ) ) . '/avatars/' . $user_id;
+	$newurl = trailingslashit( get_blog_option( BP_ROOT_BLOG, 'siteurl' ) ) . '/avatars/' . $user_id;
 	$newburl = $newurl;
 	$newsubdir = '/avatars/' . $user_id;
 
Index: bp-core/bp-core-templatetags.php
===================================================================
--- bp-core/bp-core-templatetags.php	(revision 1595)
+++ bp-core/bp-core-templatetags.php	(working copy)
@@ -218,7 +218,7 @@
 }
 
 function bp_site_name() {
-	echo apply_filters( 'bp_site_name', get_blog_option( 1, 'blogname' ) );
+	echo apply_filters( 'bp_site_name', get_blog_option( BP_ROOT_BLOG, 'blogname' ) );
 }
 
 function bp_is_home() {
@@ -523,7 +523,7 @@
 }
 
 function bp_has_custom_activation_page() {
-	if ( file_exists( WP_CONTENT_DIR . '/themes/' . get_blog_option( 1, 'template') . '/activate.php') )
+	if ( file_exists( WP_CONTENT_DIR . '/themes/' . get_blog_option( BP_ROOT_BLOG, 'template') . '/activate.php') )
 		return true;
 	
 	return false;
Index: bp-friends/bp-friends-notifications.php
===================================================================
--- bp-friends/bp-friends-notifications.php	(revision 1595)
+++ bp-friends/bp-friends-notifications.php	(working copy)
@@ -18,7 +18,7 @@
 
 	// Set up and send the message
 	$to = $ud->user_email;
-	$subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'New friendship request from %s', 'buddypress' ), $initiator_name );
+	$subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'New friendship request from %s', 'buddypress' ), $initiator_name );
 
 	$message = sprintf( __( 
 "%s wants to add you as a friend.
@@ -55,7 +55,7 @@
 		
 	// Set up and send the message
 	$to = $ud->user_email;
-	$subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( '%s accepted your friendship request', 'buddypress' ), $friend_name );
+	$subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( '%s accepted your friendship request', 'buddypress' ), $friend_name );
 
 	$message = sprintf( __( 
 '%s accepted your friend request.
Index: bp-groups/bp-groups-notifications.php
===================================================================
--- bp-groups/bp-groups-notifications.php	(revision 1595)
+++ bp-groups/bp-groups-notifications.php	(working copy)
@@ -13,7 +13,7 @@
 	$poster_ud = get_userdata( $wire_post->user_id );
 	$poster_profile_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $poster_ud->user_login;
 
-	$subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'New wire post on group: %s', 'buddypress' ), stripslashes($group->name) );
+	$subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'New wire post on group: %s', 'buddypress' ), stripslashes($group->name) );
 
 	foreach ( $group->user_dataset as $user ) {
 		if ( 'no' == get_usermeta( $user->user_id, 'notification_groups_wire_post' ) ) continue;
@@ -56,7 +56,7 @@
 	global $bp;
 	
 	$group = new BP_Groups_Group( $group_id, false, true );
-	$subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . __( 'Group Details Updated', 'buddypress' );
+	$subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . __( 'Group Details Updated', 'buddypress' );
 
 	foreach ( $group->user_dataset as $user ) {
 		if ( 'no' == get_usermeta( $user->user_id, 'notification_groups_group_updated' ) ) continue;
@@ -106,7 +106,7 @@
 
 	// Set up and send the message
 	$to = $ud->user_email;
-	$subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group: %s', 'buddypress' ), stripslashes($group->name) );
+	$subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group: %s', 'buddypress' ), stripslashes($group->name) );
 
 $message = sprintf( __( 
 '%s wants to join the group "%s".
@@ -150,7 +150,7 @@
 	$to = $ud->user_email;
 	
 	if ( $accepted ) {
-		$subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), stripslashes($group->name) );
+		$subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), stripslashes($group->name) );
 		$message = sprintf( __( 
 'Your membership request for the group "%s" has been accepted.
 
@@ -160,7 +160,7 @@
 ', 'buddypress' ), stripslashes($group->name), $group_link );
 		
 	} else {
-		$subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group "%s" rejected', 'buddypress' ), stripslashes($group->name) );
+		$subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group "%s" rejected', 'buddypress' ), stripslashes($group->name) );
 		$message = sprintf( __( 
 'Your membership request for the group "%s" has been rejected.
 
@@ -202,7 +202,7 @@
 	// Set up and send the message
 	$to = $ud->user_email;
 
-	$subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'You have been promoted in the group: "%s"', 'buddypress' ), stripslashes($group->name) );
+	$subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'You have been promoted in the group: "%s"', 'buddypress' ), stripslashes($group->name) );
 
 	$message = sprintf( __( 
 'You have been promoted to %s for the group: "%s".
@@ -245,7 +245,7 @@
 		// Set up and send the message
 		$to = $invited_ud->user_email;
 
-		$subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), stripslashes($group->name) );
+		$subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), stripslashes($group->name) );
 
 		$message = sprintf( __( 
 'One of your friends %s has invited you to the group: "%s".
Index: bp-messages/bp-messages-notifications.php
===================================================================
--- bp-messages/bp-messages-notifications.php	(revision 1595)
+++ bp-messages/bp-messages-notifications.php	(working copy)
@@ -17,7 +17,7 @@
 		
 		// Set up and send the message
 		$to = $ud->user_email;
-		$subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'New message from %s', 'buddypress' ), stripslashes($sender_name) );
+		$subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'New message from %s', 'buddypress' ), stripslashes($sender_name) );
 
 		$content = sprintf( __( 
 '%s sent you a new message:
@@ -64,7 +64,7 @@
 // To view the notice: %s
 // 
 // ---------------------
-// ', 'buddypress' ), get_blog_option( 1, 'blogname' ), stripslashes( strip_tags( $message_subject ) ), stripslashes( strip_tags( $message ) ), $message_link );
+// ', 'buddypress' ), get_blog_option( BP_ROOT_BLOG, 'blogname' ), stripslashes( strip_tags( $message_subject ) ), stripslashes( strip_tags( $message ) ), $message_link );
 // 
 // 		$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
 // 
Index: bp-xprofile/bp-xprofile-notifications.php
===================================================================
--- bp-xprofile/bp-xprofile-notifications.php	(revision 1595)
+++ bp-xprofile/bp-xprofile-notifications.php	(working copy)
@@ -34,7 +34,7 @@
 			
 			// Set up and send the message
 			$to = $ud->user_email;
-			$subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( '%s posted on your wire.', 'buddypress' ), stripslashes($poster_name) );
+			$subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( '%s posted on your wire.', 'buddypress' ), stripslashes($poster_name) );
 
 $message = sprintf( __( 
 '%s posted on your wire:
