Some improvements to namespace sharing.