[client] Fix bugs when cloning a large library.