
diff --git a/includes/admin/tools.php b/includes/admin/tools.php
index 3803aab..7e22df0 100644
--- a/includes/admin/tools.php
+++ b/includes/admin/tools.php
@@ -500,7 +500,7 @@ function bbp_admin_repair_forum_reply_count() {
 	if ( is_wp_error( $wpdb->query( $sql_delete ) ) ) {
  		return array( 1, sprintf( $statement, $result ) );
 	}
- 
+
 	// Recalculate the metas key _bbp_reply_count and _bbp_total_reply_count for each forum
 	$forums = get_posts( array( 'post_type' => bbp_get_forum_post_type(), 'numberposts' => -1 ) );
 	if ( !empty( $forums ) ) {
@@ -864,11 +864,16 @@ function bbp_admin_repair_freshness() {
 		return array( 1, sprintf( $statement, $result ) );
 
 	// Next, give all the topics with replies the ID their last reply.
-	if ( is_wp_error( $wpdb->query( "INSERT INTO `$wpdb->postmeta` (`post_id`, `meta_key`, `meta_value`)
-			( SELECT `topic`.`ID`, '_bbp_last_reply_id', MAX( `reply`.`ID` )
-			FROM `$wpdb->posts` AS `topic` INNER JOIN `$wpdb->posts` AS `reply` ON `topic`.`ID` = `reply`.`post_parent`
-			WHERE `reply`.`post_status` IN ( '" . bbp_get_public_status_id() . "' ) AND `topic`.`post_type` = 'topic' AND `reply`.`post_type` = 'reply'
-			GROUP BY `topic`.`ID` );" ) ) )
+	if ( is_wp_error( $wpdb->query( "INSERT INTO `$wpdb->postmeta` (`post_id`, `meta_key`, `meta_value`) (
+		SELECT `post_parent`, '_bbp_last_reply_id', `ID` FROM `wp_posts` WHERE `post_date` IN
+			(SELECT MAX( `reply`.`post_date`) as rDate
+			FROM `wp_posts` AS `topic`
+				INNER JOIN `wp_posts` AS `reply`
+				ON `topic`.`ID` = `reply`.`post_parent`
+				WHERE `reply`.`post_status` IN ( 'publish' )
+				AND `topic`.`post_type` = 'topic'
+				AND `reply`.`post_type` = 'reply'
+			GROUP BY `topic`.`ID`) );" ) ) )
 		return array( 2, sprintf( $statement, $result ) );
 
 	// For any remaining topics, give a reply ID of 0.
@@ -880,11 +885,18 @@ function bbp_admin_repair_freshness() {
 		return array( 3, sprintf( $statement, $result ) );
 
 	// Now we give all the forums with topics the ID their last topic.
-	if ( is_wp_error( $wpdb->query( "INSERT INTO `$wpdb->postmeta` (`post_id`, `meta_key`, `meta_value`)
-			( SELECT `forum`.`ID`, '_bbp_last_topic_id', `topic`.`ID`
-			FROM `$wpdb->posts` AS `forum` INNER JOIN `$wpdb->posts` AS `topic` ON `forum`.`ID` = `topic`.`post_parent`
-			WHERE `topic`.`post_status` IN ( '" . bbp_get_public_status_id() . "' ) AND `forum`.`post_type` = 'forum' AND `topic`.`post_type` = 'topic'
-			GROUP BY `forum`.`ID` );" ) ) )
+	// This gives the last topic created vs the last topic updated.
+	if ( is_wp_error( $wpdb->query( "INSERT INTO `$wpdb->postmeta` (`post_id`, `meta_key`, `meta_value`) (
+		SELECT `post_parent` as fID,  '_bbp_last_topic_id', `ID` as tID FROM `wp_posts` WHERE `post_date` IN (
+            SELECT MAX( `topic`.`post_date`) as tDate
+			FROM `wp_posts` AS `forum`
+				INNER JOIN `wp_posts` AS `topic`
+				ON `forum`.`ID` = `topic`.`post_parent`
+				WHERE `topic`.`post_status` IN ( 'publish' )
+				AND `forum`.`post_type` = 'forum'
+				AND `topic`.`post_type` = 'topic'
+			GROUP BY `forum`.`ID` ) );" ) ) )
+
 		return array( 4, sprintf( $statement, $result ) );
 
 	// For any remaining forums, give a topic ID of 0.
@@ -896,11 +908,16 @@ function bbp_admin_repair_freshness() {
 		return array( 5, sprintf( $statement, $result ) );
 
 	// After that, we give all the topics with replies the ID their last reply (again, this time for a different reason).
-	if ( is_wp_error( $wpdb->query( "INSERT INTO `$wpdb->postmeta` (`post_id`, `meta_key`, `meta_value`)
-			( SELECT `topic`.`ID`, '_bbp_last_active_id', MAX( `reply`.`ID` )
-			FROM `$wpdb->posts` AS `topic` INNER JOIN `$wpdb->posts` AS `reply` ON `topic`.`ID` = `reply`.`post_parent`
-			WHERE `reply`.`post_status` IN ( '" . bbp_get_public_status_id() . "' ) AND `topic`.`post_type` = 'topic' AND `reply`.`post_type` = 'reply'
-			GROUP BY `topic`.`ID` );" ) ) )
+	if ( is_wp_error( $wpdb->query( "INSERT INTO `$wpdb->postmeta` (`post_id`, `meta_key`, `meta_value`)(
+			SELECT `post_parent`, '_bbp_last_active_id', `ID` FROM `wp_posts` WHERE `post_date` IN
+			(SELECT MAX( `reply`.`post_date`) as rDate
+			FROM `wp_posts` AS `topic`
+				INNER JOIN `wp_posts` AS `reply`
+				ON `topic`.`ID` = `reply`.`post_parent`
+				WHERE `reply`.`post_status` IN ( 'publish' )
+				AND `topic`.`post_type` = 'topic'
+				AND `reply`.`post_type` = 'reply'
+			GROUP BY `topic`.`ID`) );" ) ) )
 		return array( 6, sprintf( $statement, $result ) );
 
 	// For any remaining topics, give a reply ID of themself.
@@ -1149,7 +1166,7 @@ function bbp_admin_repair_reply_menu_order() {
 
 	// Delete cases where `_bbp_reply_to` was accidentally set to itself
 	if ( is_wp_error( $wpdb->query( "DELETE FROM `{$wpdb->postmeta}` WHERE `meta_key` = '_bbp_reply_to' AND `post_id` = `meta_value`;" ) ) ) {
-		return array( 1, sprintf( $statement, $result ) ); 
+		return array( 1, sprintf( $statement, $result ) );
 	}
 
 	// Post type
diff --git a/includes/common/functions.php b/includes/common/functions.php
index bd5c481..69dcb4e 100644
--- a/includes/common/functions.php
+++ b/includes/common/functions.php
@@ -1596,7 +1596,7 @@ function bbp_get_public_child_ids( $parent_id = 0, $post_type = 'post' ) {
 		// Join post statuses together
 		$post_status = "'" . implode( "', '", $post_status ) . "'";
 
-		$child_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = '%s' ORDER BY ID DESC;", $parent_id, $post_type ) );
+		$child_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = '%s' ORDER BY post_date DESC;", $parent_id, $post_type ) );
 		wp_cache_set( $cache_id, $child_ids, 'bbpress_posts' );
 	}
 
@@ -1659,7 +1659,7 @@ function bbp_get_all_child_ids( $parent_id = 0, $post_type = 'post' ) {
 		// Join post statuses together
 		$post_status = "'" . implode( "', '", $post_status ) . "'";
 
-		$child_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = '%s' ORDER BY ID DESC;", $parent_id, $post_type ) );
+		$child_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = '%s' ORDER BY post_date DESC;", $parent_id, $post_type ) );
 		wp_cache_set( $cache_id, $child_ids, 'bbpress_posts' );
 	}
 
diff --git a/includes/forums/functions.php b/includes/forums/functions.php
index 050791d..f92d863 100644
--- a/includes/forums/functions.php
+++ b/includes/forums/functions.php
@@ -1236,13 +1236,14 @@ function bbp_update_forum_last_reply_id( $forum_id = 0, $reply_id = 0 ) {
 
 		// If this forum has topics...
 		$topic_ids = bbp_forum_query_topic_ids( $forum_id );
+
 		if ( !empty( $topic_ids ) ) {
 
 			// ...get the most recent reply from those topics...
 			$reply_id = bbp_forum_query_last_reply_id( $forum_id, $topic_ids );
 
-			// ...and compare it to the most recent topic id...
-			$reply_id = ( $reply_id > max( $topic_ids ) ) ? $reply_id : max( $topic_ids );
+			// ...and compare it to the most recent topic id... (most recent refers to date not ID)
+			// $reply_id = ( $reply_id > max( $topic_ids ) ) ? $reply_id : max( $topic_ids );
 		}
 	}
 
@@ -1302,7 +1303,7 @@ function bbp_update_forum_last_active_id( $forum_id = 0, $active_id = 0 ) {
 		$topic_ids = bbp_forum_query_topic_ids( $forum_id );
 		if ( !empty( $topic_ids ) ) {
 			$active_id = bbp_forum_query_last_reply_id( $forum_id, $topic_ids );
-			$active_id = $active_id > max( $topic_ids ) ? $active_id : max( $topic_ids );
+			//$active_id = $active_id > max( $topic_ids ) ? $active_id : max( $topic_ids );
 
 		// Forum has no topics
 		} else {
@@ -1933,16 +1934,18 @@ function bbp_forum_query_last_reply_id( $forum_id, $topic_ids = 0 ) {
 	$cache_id = 'bbp_get_forum_' . $forum_id . '_reply_id';
 	$reply_id = (int) wp_cache_get( $cache_id, 'bbpress_posts' );
 
-	if ( false === $reply_id ) {
+	if ( 0 === $reply_id  || false === $reply_id ) {
 
 		if ( empty( $topic_ids ) ) {
 			$topic_ids = bbp_forum_query_topic_ids( $forum_id );
 		}
 
 		if ( !empty( $topic_ids ) ) {
+
 			$topic_ids = implode( ',', wp_parse_id_list( $topic_ids ) );
-			$reply_id  = (int) $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent IN ( {$topic_ids} ) AND post_status = '%s' AND post_type = '%s' ORDER BY ID DESC LIMIT 1;", bbp_get_public_status_id(), bbp_get_reply_post_type() ) );
+			$reply_id  = (int) $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent IN ( {$topic_ids} ) AND post_status = '%s' AND post_type = '%s' ORDER BY post_date DESC LIMIT 1;", bbp_get_public_status_id(), bbp_get_reply_post_type() ) );
 			wp_cache_set( $cache_id, $reply_id, 'bbpress_posts' ); // May be (int) 0
+
 		} else {
 			wp_cache_set( $cache_id, '0', 'bbpress_posts' );
 		}
