Fix handling of resource deletion for shares