Fix looking up unhashable types for type inference