fixes to name scoping issues across type/term namespaces