Minor corrections in NameRes monad.
Translating TypeMap from old compiler to current.