Make the breadcrumb link code more robust