Fix Relation.rewhere to work with Range values