Fix rare circumstances where DOM elements do not have a string ID