Fix generic relation for documents