Handle errors in _getElementsByXpath so they don't choke on invalid XPath