Works fine for me, nothing is replaced, it's just appended to the navigation. Are you sure that it's not just a styling-issue? Have you looked at the document source to check if it really is replacing the other menu items?
What exactly do you mean by making it the parent item? Do you want to turn
<li><a href="">Item</a></li>
into
<li><a href="">Welcome $user</a>
<ul>
<li><a href="">Item</a></li>
</ul>
</li>
in the end?
To change your menu and make it easy & maintainable, maybe you could use something like this:
add_filter( 'wp_nav_menu_objects', 'my_custom_menu_item');
function my_custom_menu_item($items) {
$remove_childs_of = array();
foreach($items as $index => $item) {
if($item->title == "##currentuser##") {
if(is_user_logged_in()) {
$user=wp_get_current_user();
$name=$user->display_name; // or user_login , user_firstname, user_lastname
$items[$index]->title = $name;
}
else {
array_push($remove_childs_of, $item->ID);
unset($items[$index]);
}
}
if(!empty($remove_childs_of) && in_array($item->menu_item_parent, $remove_childs_of)) {
array_push($remove_childs_of, $item->ID);
unset($items[$index]);
}
}
return $items;
}
The wp_nav_menu_objects
filter allows us to work on the items before they get transformed into HTML. You'll have to add an Item to your menu that shows "##currentuser##". If a user is logged in, this menu item will show his name afterwards. If it is an anonymous user, the menu item and its submenues will be removed from the navigation.