Fix for XPath generation