Fixed the tests for the rebuilding of documents.