Tweak to loop termination in sem_check_subtype