Fix problems with IN and BETWEEN handling with shard keys