Index: bp-activity/bp-activity-actions.php
===================================================================
--- bp-activity/bp-activity-actions.php	(revision 4493)
+++ bp-activity/bp-activity-actions.php	(working copy)
@@ -13,7 +13,7 @@ function bp_register_activity_actions() {
 add_action( 'bp_init', 'bp_register_activity_actions', 8 );
 
 function bp_activity_action_permalink_router() {
-	global $bp;
+	global $bp, $wp_query;
 
 	// Not viewing activity
 	if ( ( $bp->activity->slug != bp_current_component() ) || !bp_is_current_action( 'p' ) )
@@ -26,9 +26,13 @@ function bp_activity_action_permalink_router() {
 	// Get the activity details
 	$activity = bp_activity_get_specific( array( 'activity_ids' => $bp->action_variables[0] ) );
 
-	// Redirect to root if activity does not exist
-	if ( !$activity = $activity['activities'][0] )
-		bp_core_redirect( bp_get_root_domain() );
+	// 404 if activity does not exist
+	if ( !$activity = $activity['activities'][0] ) {
+		$wp_query->set_404();
+		status_header( 404 );
+		nocache_headers();
+		return;
+	}
 
 	// Do not redirect at default
 	$redirect = false;
Index: bp-activity/bp-activity-screens.php
===================================================================
--- bp-activity/bp-activity-screens.php	(revision 4493)
+++ bp-activity/bp-activity-screens.php	(working copy)
@@ -83,7 +83,7 @@ function bp_activity_reset_my_new_mentions() {
 add_action( 'bp_activity_screen_mentions', 'bp_activity_reset_my_new_mentions' );
 
 function bp_activity_screen_single_activity_permalink() {
-	global $bp;
+	global $bp, $wp_query;
 
 	// No displayed user or not viewing activity component
 	if ( !bp_is_activity_component() )
@@ -95,8 +95,13 @@ function bp_activity_screen_single_activity_permalink() {
 	// Get the activity details
 	$activity = bp_activity_get_specific( array( 'activity_ids' => bp_current_action() ) );
 
-	if ( !$activity = $activity['activities'][0] )
-		bp_core_redirect( bp_get_root_domain() );
+	// 404 if activity does not exist
+	if ( !$activity = $activity['activities'][0] ) {
+		$wp_query->set_404();
+		status_header( 404 );
+		nocache_headers();
+		return;
+	}
 
 	// Default access is true
 	$has_access = true;
@@ -105,8 +110,12 @@ function bp_activity_screen_single_activity_permalink() {
 	if ( isset( $bp->groups->id ) && $activity->component == $bp->groups->id ) {
 
 		// Activity is from a group, but groups is currently disabled
-		if ( !bp_is_active( 'groups') )
-			bp_core_redirect( bp_get_root_domain() );
+		if ( !bp_is_active( 'groups') ) {
+			$wp_query->set_404();
+			status_header( 404 );
+			nocache_headers();
+			return;
+		}
 
 		// Check to see if the group is not public, if so, check the
 		// user has access to see this activity
Index: bp-core/bp-core-catchuri.php
===================================================================
--- bp-core/bp-core-catchuri.php	(revision 4493)
+++ bp-core/bp-core-catchuri.php	(working copy)
@@ -27,7 +27,7 @@ Modified for BuddyPress by: Andy Peatling - http://apeatling.wordpress.com/
  */
 function bp_core_set_uri_globals() {
 	global $bp, $bp_unfiltered_uri, $bp_unfiltered_uri_offset;
-	global $current_blog, $wpdb;
+	global $current_blog, $wpdb, $wp_query;
 
 	// Create global component, action, and item variables
 	$bp->current_component = $bp->current_action = $bp->current_item ='';
@@ -242,6 +242,19 @@ function bp_core_set_uri_globals() {
 				else
 					$bp->displayed_user->id = (int) bp_core_get_userid_from_nicename( urldecode( $bp_uri[$uri_offset + 1] ) );
 
+				if ( empty( $bp->displayed_user->id ) ) {
+					$wp_query->set_404(); 
+					status_header( 404 ); 
+					nocache_headers();
+					
+					// Prevent components from loading their templates
+					$bp->current_component = ''; 
+					
+					// Prevent WP from guessing on a redirect
+					remove_action( 'template_redirect', 'redirect_canonical' );
+					return;
+				}
+
 				// Bump the offset
 				if ( isset( $bp_uri[$uri_offset + 2] ) ) {
 					$bp_uri                = array_merge( array(), array_slice( $bp_uri, $uri_offset + 2 ) );
@@ -351,32 +364,30 @@ function bp_core_catch_profile_uri() {
  * @since 1.3
  */
 function bp_core_catch_no_access() {
-	global $bp, $wp_query, $bp_unfiltered_uri, $bp_no_status_set;
+	global $bp, $bp_no_status_set, $wp_query;
 
 	// If bp_core_redirect() and $bp_no_status_set is true,
 	// we are redirecting to an accessible page, so skip this check.
 	if ( $bp_no_status_set )
 		return false;
 
-	// If the displayed user was marked as a spammer and the logged-in user is not a super admin, redirect
+	// If the displayed user was marked as a spammer and the logged-in user is not a super admin, 404.
 	if ( isset( $bp->displayed_user->id ) && bp_core_is_user_spammer( $bp->displayed_user->id ) ) {
-		if ( !is_super_admin() )
-			bp_core_redirect( $bp->root_domain );
-		else
+		if ( !$bp->loggedin_user->is_super_admin ) {
+			$wp_query->set_404();
+			status_header( 404 );
+			nocache_headers();
+			return;
+
+		} else {
 			bp_core_add_message( __( 'This user has been marked as a spammer. Only site admins can view this profile.', 'buddypress' ), 'error' );
+		}
 	}
 
-	// If BP_ENABLE_ROOT_PROFILES is not defined and the displayed user does not exist, redirect
-	if ( !$bp->displayed_user->id && isset( $bp_unfiltered_uri[0] ) && $bp_unfiltered_uri[0] == $bp->members->slug && isset( $bp_unfiltered_uri[1] ) )
-		bp_core_redirect( $bp->root_domain );
-
-	// Access control!
 	if ( !isset( $wp_query->queried_object ) && !bp_is_blog_page() ) {
-		if ( is_user_logged_in() ) {
-			bp_core_no_access( array( 'redirect' => false, 'message' => __( 'You do not have access to that page', 'buddypress' ) ) );
-		} else {
-			bp_core_no_access();
-		}
+		$wp_query->set_404();
+		status_header( 404 );
+		nocache_headers();
 	}
 }
 add_action( 'wp', 'bp_core_catch_no_access' );
@@ -402,15 +413,6 @@ function bp_core_no_access( $args = '' ) {
 	$r = wp_parse_args( $args, $defaults );
 	extract( $r, EXTR_SKIP );
 
-	// Group filtering
-	// When a user doesn't have access to a group's activity / secondary page, redirect to group's homepage
-	if ( !$redirect ) {
-		if ( bp_is_active( 'groups' ) && bp_is_current_component( 'groups' ) ) {
-			$root = bp_get_group_permalink( $bp->groups->current_group );
-			$message = false;
-		}
-	}
-
 	// Apply filters to these variables
 	$mode		= apply_filters( 'bp_no_access_mode', $mode, $root, $redirect, $message );
 	$redirect	= apply_filters( 'bp_no_access_redirect', $redirect, $root, $message, $mode );
Index: bp-core/bp-core-component.php
===================================================================
--- bp-core/bp-core-component.php	(revision 4493)
+++ bp-core/bp-core-component.php	(working copy)
@@ -98,7 +98,7 @@ class BP_Component {
 	 * @param arr $args Used to
 	 */
 	function _setup_globals( $args = '' ) {
-		global $bp;
+		global $bp, $wp_query;
 
 		/** Slugs *************************************************************/
 
@@ -127,6 +127,13 @@ class BP_Component {
 		if ( !empty( $r['global_tables'] ) )
 			foreach ( $r['global_tables'] as $global_name => $table_name )
 				$this->$global_name = $table_name;
+				
+		if ( isset( $bp->is_specific_member ) && empty( $bp->displayed_user->id ) ) {
+			$wp_query->set_404(); 
+			status_header( 404 ); 
+			nocache_headers();
+			return;
+		}
 		
 		/** BuddyPress ********************************************************/
 
Index: bp-core/bp-core-template.php
===================================================================
--- bp-core/bp-core-template.php	(revision 4493)
+++ bp-core/bp-core-template.php	(working copy)
@@ -246,8 +246,9 @@ function bp_get_page_title() {
 
 	// A single group
 	} elseif ( bp_is_active( 'groups' ) && !empty( $bp->groups->current_group ) && !empty( $bp->bp_options_nav[$bp->groups->current_group->slug] ) ) {
+		$subnav = isset( $bp->bp_options_nav[$bp->groups->current_group->slug][$bp->current_action]['name'] ) ? $bp->bp_options_nav[$bp->groups->current_group->slug][$bp->current_action]['name'] : '';
 		// translators: "group name | group nav section name"
-		$title = sprintf( __( '%1$s &#124; %2$s', 'buddypress' ), $bp->bp_options_title, $bp->bp_options_nav[$bp->groups->current_group->slug][$bp->current_action]['name'] );
+		$title = sprintf( __( '%1$s &#124; %2$s', 'buddypress' ), $bp->bp_options_title, $subnav );
 
 	// A single item from a component other than groups
 	} elseif ( bp_is_single_item() ) {
Index: bp-groups/bp-groups-filters.php
===================================================================
--- bp-groups/bp-groups-filters.php	(revision 4493)
+++ bp-groups/bp-groups-filters.php	(working copy)
@@ -105,8 +105,8 @@ function groups_add_forum_where_sql( $sql = '' ) {
 	elseif ( is_super_admin() )
 		unset( $parts['private'] );
 
-	// Are we a member of this group
-	elseif ( bp_is_single_item() && bp_group_is_member( $bp->groups->current_group->id ) )
+	// No need to filter on a single item
+	elseif ( bp_is_single_item() )
 		unset( $parts['private'] );
 
 	// Check the SQL filter that was passed
Index: bp-groups/bp-groups-loader.php
===================================================================
--- bp-groups/bp-groups-loader.php	(revision 4493)
+++ bp-groups/bp-groups-loader.php	(working copy)
@@ -61,7 +61,7 @@ class BP_Groups_Component extends BP_Component {
 	 * @global obj $bp
 	 */
 	function _setup_globals() {
-		global $bp;
+		global $bp, $wp_query;
 
 		// Define a slug, if necessary
 		if ( !defined( 'BP_GROUPS_SLUG' ) )
@@ -155,6 +155,19 @@ class BP_Groups_Component extends BP_Component {
 			$this->root_slug,
 		) );
 
+		// If the user was attempting to access a group, but no group by that name was
+		// found, 404
+		if ( empty( $this->current_group ) && !empty( $bp->current_action ) && !in_array( $bp->current_action, $this->forbidden_names ) ) {
+			$wp_query->set_404(); 
+			status_header( 404 ); 
+			nocache_headers();
+		}
+		
+		// Group access control
+		if ( !empty( $this->current_group ) && !$this->current_group->user_has_access ) {
+			bp_core_no_access();
+		}
+
 		// Preconfigured group creation steps
 		$this->group_creation_steps = apply_filters( 'groups_create_group_steps', array(
 			'group-details'  => array(
Index: bp-groups/bp-groups-screens.php
===================================================================
--- bp-groups/bp-groups-screens.php	(revision 4493)
+++ bp-groups/bp-groups-screens.php	(working copy)
@@ -107,8 +107,11 @@ function groups_screen_group_forum() {
 
 	if ( !bp_is_active( 'forums' ) || !bp_forums_is_installed_correctly() )
 		return false;
+		
+	if ( !$bp->groups->current_group->user_has_access )
+		bp_core_no_access();
 
-	if ( bp_is_single_item() && $bp->groups->current_group->user_has_access ) {
+	if ( bp_is_single_item() ) {
 
 		// Fetch the details we need
 		$topic_slug     = !empty( $bp->action_variables[1] ) ? $bp->action_variables[1] : false;
Index: bp-members/bp-members-loader.php
===================================================================
--- bp-members/bp-members-loader.php	(revision 4493)
+++ bp-members/bp-members-loader.php	(working copy)
@@ -58,7 +58,7 @@ class BP_Members_Component extends BP_Component {
 	 * @global obj $bp
 	 */
 	function _setup_globals() {
-		global $bp, $current_user, $displayed_user_id;
+		global $bp, $current_user, $displayed_user_id, $wp_query;
 
 		// Define a slug, if necessary
 		if ( !defined( 'BP_MEMBERS_SLUG' ) )
Index: bp-xprofile/bp-xprofile-screens.php
===================================================================
--- bp-xprofile/bp-xprofile-screens.php	(revision 4493)
+++ bp-xprofile/bp-xprofile-screens.php	(working copy)
@@ -13,6 +13,15 @@
  * @uses bp_core_load_template() Looks for and loads a template file within the current member theme (folder/filename)
  */
 function xprofile_screen_display_profile() {
+	global $bp, $wp_query;
+	
+	if ( empty( $bp->displayed_user->id ) ) {
+		$wp_query->set_404(); 
+		status_header( 404 ); 
+		nocache_headers(); 
+		return; 
+	} 
+	
 	$new = isset( $_GET['new'] ) ? $_GET['new'] : '';
 
 	do_action( 'xprofile_screen_display_profile', $new );
@@ -28,7 +37,7 @@ function xprofile_screen_display_profile() {
  * @uses bp_core_load_template() Looks for and loads a template file within the current member theme (folder/filename)
  */
 function xprofile_screen_edit_profile() {
-	global $bp;
+	global $bp, $wp_query;
 
 	if ( !bp_is_my_profile() && !is_super_admin() )
 		return false;
@@ -38,8 +47,12 @@ function xprofile_screen_edit_profile() {
 		bp_core_redirect( $bp->displayed_user->domain . $bp->profile->slug . '/edit/group/1' );
 
 	// Check the field group exists
-	if ( !xprofile_get_field_group( $bp->action_variables[1] ) )
-		bp_core_redirect( bp_get_root_domain() );
+	if ( !xprofile_get_field_group( $bp->action_variables[1] ) ) {
+		$wp_query->set_404();
+		status_header( 404 );
+		nocache_headers();
+		return;
+	}
 
 	// Check to see if any new information has been submitted
 	if ( isset( $_POST['field_ids'] ) ) {
