Fix bugs affecting non-sharing mode