ChildrenQuery and ParentQuery now take into account documents that have been marked.

Closes #3144