Fixed error when no element was given in XPath