Fixed #7954: Out of memory error on token export