Some fixes in sharing