WyC: bug fix for disambiguating casts.  actually it's rather complex unfortunately.