This also includes some fixes to make this axis behave correctly when evaluate relative to a document.