Merge pull request #67 from eguaj/1.4-A2786

Reverted changes from previous #2786 commit (closes #2786)
Corrected XPath expression for root dirs with special chars (refs #2786)
Fixed erroneous sprintf() (refs #2786)