added check against wrong kind of value for hashsets.