I suspect that the html(or its css at least) of the badge icon is responsible for its disappearance, as in it is not correctly put together.Post a code sample, and we will try to fix it. As for the number not being updated until refresh, my first question would be do you capture the event when a buyer puts something in the cart? That would be the time to update the number, say like:
$("#cart").on('update', undefined, cart.NumberOfItems, updateBadgeIcon);
function updateBadgeIcon(event)
{
var newNumber = event.Data;
$('#badgeNumber').html(newNumber);
};
Take a look at jQuery documentation, and jQuery on method.