fixed a couple of bugs in the visitors related to ExtendedDocument