Fix bugs in shared repositories and copying items