Added better details to error logging in applyXPaths