Apply Jeff's patch to ent_mismatch subroutine definition