Fixed an issue where unsharing directories was failing.