Fixed bug in isSubType