Fix name resolution of type definitions