fix an issue occurring when the previous sibling has no name.

Hi,

I'm running into an issue when the previous sibling has no name attribute. The replace is applied on an undefined object and crashes.

Here is a fix. I'm simply testing the presence of a name attribute.