canonicalText of ScType fixed and refactored