Some fixes in sharing etc.