Fixed a potential NPE in Type