bugfixes: better resolution of type names