Index: wp-admin/edit-comments.php
===================================================================
--- wp-admin/edit-comments.php	(revision 12905)
+++ wp-admin/edit-comments.php	(working copy)
@@ -192,12 +192,12 @@
 	$link = add_query_arg( 'comment_type', $comment_type, $link );
 
 foreach ( $stati as $status => $label ) {
-	$class = '';
+	$class = ( $status == $comment_status ) ? ' class="current"' : '';
 
-	if ( $status == $comment_status )
-		$class = ' class="current"';
 	if ( !isset( $num_comments->$status ) )
 		$num_comments->$status = 10;
+	if ( empty( $num_comments->$status ) )
+		continue;
 	$link = add_query_arg( 'comment_status', $status, $link );
 	if ( $post_id )
 		$link = add_query_arg( 'p', absint( $post_id ), $link );
@@ -270,6 +270,7 @@
 
 <div class="tablenav">
 
+<?php if ( $comments ) { ?>
 <?php if ( $page_links ) : ?>
 <div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
 	number_format_i18n( $start + 1 ),
@@ -346,7 +347,6 @@
 
 <div class="clear"></div>
 
-<?php if ( $comments ) { ?>
 <table class="widefat comments fixed" cellspacing="0">
 <thead>
 	<tr>
Index: wp-admin/upload.php
===================================================================
--- wp-admin/upload.php	(revision 12905)
+++ wp-admin/upload.php	(working copy)
@@ -143,7 +143,8 @@
 	} else {
 		$start = ( (int) $_GET['paged'] - 1 ) * $media_per_page;
 		$orphans = $wpdb->get_results( $wpdb->prepare( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1 LIMIT %d, %d", $start, $media_per_page ) );
-		$page_links_total = ceil($wpdb->get_var( "SELECT FOUND_ROWS()" ) / $media_per_page);
+		$total_orphans = $wpdb->get_var( "SELECT FOUND_ROWS()" );
+		$page_links_total = ceil( $total_orphans / $media_per_page );
 	}
 
 	$post_mime_types = get_post_mime_types();
@@ -219,6 +220,8 @@
 $type_links = array();
 $_num_posts = (array) wp_count_attachments();
 $_total_posts = array_sum($_num_posts) - $_num_posts['trash'];
+if ( !isset( $total_orphans ) )
+		$total_orphans = $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1" );
 $matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_posts));
 foreach ( $matches as $type => $reals )
 	foreach ( $reals as $real )
@@ -234,11 +237,12 @@
 
 	if ( !empty($_GET['post_mime_type']) && wp_match_mime_types($mime_type, $_GET['post_mime_type']) )
 		$class = ' class="current"';
+	if ( !empty( $num_posts[$mime_type] ) )
+		$type_links[] = "<li><a href='upload.php?post_mime_type=$mime_type'$class>" . sprintf( _n( $label[2][0], $label[2][1], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</a>';
+}
+$type_links[] = '<li><a href="upload.php?detached=1"' . ( isset($_GET['detached']) ? ' class="current"' : '' ) . '>' . sprintf( _nx( 'Unattached <span class="count">(%s)</span>', 'Unattached <span class="count">(%s)</span>', $total_orphans, 'detached files' ), number_format_i18n( $total_orphans ) ) . '</a>';
 
-	$type_links[] = "<li><a href='upload.php?post_mime_type=$mime_type'$class>" . sprintf( _n( $label[2][0], $label[2][1], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</a>';
-}
-$type_links[] = '<li><a href="upload.php?detached=1"' . ( isset($_GET['detached']) ? ' class="current"' : '' ) . '>' . __('Unattached') . '</a>';
-if ( EMPTY_TRASH_DAYS && ( MEDIA_TRASH || !empty($_num_posts['trash']) ) )
+if ( !empty($_num_posts['trash']) )
 	$type_links[] = '<li><a href="upload.php?status=trash"' . ( (isset($_GET['status']) && $_GET['status'] == 'trash' ) ? ' class="current"' : '') . '>' . sprintf( _nx( 'Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>', $_num_posts['trash'], 'uploaded files' ), number_format_i18n( $_num_posts['trash'] ) ) . '</a>';
 
 echo implode( " |</li>\n", $type_links) . '</li>';
@@ -255,8 +259,10 @@
 </form>
 
 <form id="posts-filter" action="" method="get">
+<?php if ( have_posts() || isset( $orphans ) ) { ?>
 <div class="tablenav">
 <?php
+
 if ( ! isset($page_links_total) )
 	$page_links_total =  $wp_query->max_num_pages;
 
@@ -279,6 +285,7 @@
 <?php endif; ?>
 
 <div class="alignleft actions">
+<?php if ( ! isset( $orphans ) || ! empty( $orphans ) ) { ?>
 <select name="action" class="select-action">
 <option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
 <?php if ( $is_trash ) { ?>
@@ -328,7 +335,11 @@
 
 <?php } // ! is_singular ?>
 
-<?php if ( isset($_GET['detached']) ) { ?>
+<?php
+
+} // ! empty( $orphans )
+
+if ( isset($_GET['detached']) ) { ?>
 	<input type="submit" id="find_detached" name="find_detached" value="<?php esc_attr_e('Scan for lost attachments'); ?>" class="button-secondary" />
 <?php } elseif ( isset($_GET['status']) && $_GET['status'] == 'trash' && current_user_can('edit_others_posts') ) { ?>
 	<input type="submit" id="delete_all" name="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
@@ -339,9 +350,11 @@
 <br class="clear" />
 </div>
 
+<?php } // have_posts() || !empty( $orphans ) ?>
+
 <div class="clear"></div>
 
-<?php if ( isset($orphans) ) { ?>
+<?php if ( ! empty( $orphans ) ) { ?>
 <table class="widefat" cellspacing="0">
 <thead>
 <tr>
@@ -365,7 +378,6 @@
 
 <tbody id="the-list" class="list:post">
 <?php
-	if ( $orphans ) {
 		foreach ( $orphans as $post ) {
 			$class = 'alternate' == $class ? '' : 'alternate';
 			$att_title = esc_html( _draft_or_post_title($post->ID) );
@@ -423,11 +435,7 @@
 		} ?>
 		<td class="date column-date"><?php echo $h_time ?></td>
 	</tr>
-<?php	}
-
-	} else { ?>
-	<tr><td colspan="5"><?php _e('No media attachments found.') ?></td></tr>
-<?php } ?>
+<?php	} ?>
 </tbody>
 </table>
 
@@ -442,6 +450,8 @@
 <div class="tablenav">
 
 <?php
+if ( have_posts() || ! empty( $orphans ) ) {
+
 if ( $page_links )
 	echo "<div class='tablenav-pages'>$page_links_text</div>";
 ?>
@@ -466,6 +476,7 @@
 <?php } ?>
 </div>
 
+<?php } ?>
 <br class="clear" />
 </div>
 <?php find_posts_div(); ?>
Index: wp-admin/plugins.php
===================================================================
--- wp-admin/plugins.php	(revision 12905)
+++ wp-admin/plugins.php	(working copy)
@@ -630,8 +630,12 @@
 ?>
 </ul>
 
+<?php if ( ! empty( $plugins ) ) { ?>
+
 <div class="tablenav">
+
 <?php
+
 if ( $page_links )
 	echo '<div class="tablenav-pages">', $page_links_text, '</div>';
 
@@ -653,9 +657,13 @@
 print_plugin_actions($status, "action2");
 ?>
 </div>
+<?php } elseif ( ! empty( $all_plugins ) ) { ?>
+<p><?php __( 'No plugins found.' ); ?></p>
+<?php } ?>
 </form>
 
 <?php if ( empty($all_plugins) ) : ?>
+<br class="clear" />
 <p><?php _e('You do not appear to have any plugins available at this time.') ?></p>
 <?php endif; ?>
 
Index: wp-admin/edit.php
===================================================================
--- wp-admin/edit.php	(revision 12905)
+++ wp-admin/edit.php	(working copy)
@@ -400,9 +400,9 @@
 <div class="clear"></div>
 <p><?php
 if ( isset($_GET['post_status']) && 'trash' == $_GET['post_status'] )
-	_e('No posts found in the trash');
+	_e( 'No posts found in the Trash.' );
 else
-	_e('No posts found');
+	_e( 'No posts found.' );
 ?></p>
 <?php } ?>
 
Index: wp-admin/link-manager.php
===================================================================
--- wp-admin/link-manager.php	(revision 12905)
+++ wp-admin/link-manager.php	(working copy)
@@ -99,6 +99,16 @@
 <form id="posts-filter" action="" method="get">
 <div class="tablenav">
 
+<?php
+if ( 'all' == $cat_id )
+	$cat_id = '';
+$args = array( 'category' => $cat_id, 'hide_invisible' => 0, 'orderby' => $sqlorderby, 'hide_empty' => 0 );
+if ( ! empty( $_GET['s'] ) )
+	$args['search'] = $_GET['s'];
+$links = get_bookmarks( $args );
+if ( $links ) {
+?>
+
 <div class="alignleft actions">
 <select name="action">
 <option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
@@ -135,13 +145,6 @@
 <div class="clear"></div>
 
 <?php
-if ( 'all' == $cat_id )
-	$cat_id = '';
-$args = array('category' => $cat_id, 'hide_invisible' => 0, 'orderby' => $sqlorderby, 'hide_empty' => 0);
-if ( !empty($_GET['s']) )
-	$args['search'] = $_GET['s'];
-$links = get_bookmarks( $args );
-if ( $links ) {
 	$link_columns = get_column_headers('link-manager');
 	$hidden = get_hidden_columns('link-manager');
 ?>
@@ -251,10 +254,6 @@
 	</tbody>
 </table>
 
-<?php } else { ?>
-<p><?php _e('No links found.') ?></p>
-<?php } ?>
-
 <div class="tablenav">
 
 <div class="alignleft actions">
@@ -265,6 +264,10 @@
 <input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
 </div>
 
+<?php } else { ?>
+<p><?php _e( 'No links found.' ) ?></p>
+<?php } ?>
+
 <br class="clear" />
 </div>
 
