Fixed the tests on linux; need to rework the logic flow for documents/tags