--- class-wp-admin-bar.php 
+++ class-wp-admin-bar.php.diff 
@@ -121,20 +121,23 @@
 			$menuclass .= ' ' . $menu_item['meta']['class'];
 		?>
 
-		<li id="<?php echo esc_attr( "wp-admin-bar-$id" ); ?>" class="<?php echo esc_attr( $menuclass ); ?>">
-			<a href="<?php echo esc_url( $menu_item['href'] ) ?>"<?php
-				if ( ! empty( $menu_item['meta']['onclick'] ) ) :
-					?> onclick="<?php echo esc_js( $menu_item['meta']['onclick'] ); ?>"<?php
+		<li id="<?php echo esc_attr( "wp-admin-bar-$id" ); ?>" class="<?php echo esc_attr( $menuclass ); ?>"><?php
+			if ( ! empty( $menu_item['href'] ) ) : ?>
+				<a href="<?php echo esc_url( $menu_item['href'] ) ?>"<?php
+					if ( ! empty( $menu_item['meta']['onclick'] ) ) :
+						?> onclick="<?php echo esc_js( $menu_item['meta']['onclick'] ); ?>"<?php
+					endif;
+				
+				if ( ! empty( $menu_item['meta']['target'] ) ) :
+					?> target="<?php echo esc_attr( $menu_item['meta']['target'] ); ?>"<?php
 				endif;
-			if ( ! empty( $menu_item['meta']['target'] ) ) :
-				?> target="<?php echo esc_attr( $menu_item['meta']['target'] ); ?>"<?php
+				if ( ! empty( $menu_item['meta']['title'] ) ) :
+					?> title="<?php echo esc_attr( $menu_item['meta']['title'] ); ?>"<?php
+				endif;
+				
+				?>><?php
 			endif;
-			if ( ! empty( $menu_item['meta']['title'] ) ) :
-				?> title="<?php echo esc_attr( $menu_item['meta']['title'] ); ?>"<?php
-			endif;
-
-			?>><?php
-
+			
 			if ( $is_parent ) :
 				?><span><?php
 			endif;
@@ -145,7 +148,7 @@
 				?></span><?php
 			endif;
 
-			?></a>
+			if ( ! empty( $menu_item['href'] ) ) : ?></a><?php endif; ?>
 
 			<?php if ( $is_parent ) : ?>
 			<ul>
