Adding more robust handling for ulinks with and without text nodes