Improve output of ToString for type objects

fixes #8020