fix range/hash casting