Check for nextSibling before removing it.