(Failed) effort to fix occasional off-by-one error for line numbers, fixed XPath generation to be more lenient of cursor position.