Fix checking of subtype relation