Support qualified types.
Some fixes for type naming.