fixes asTypeElement for primitive types