diff --git a/fakeredis/_commands.py b/fakeredis/_commands.py
index 3d2ef57..1d25e0d 100644
--- a/fakeredis/_commands.py
+++ b/fakeredis/_commands.py
@@ -238,6 +238,9 @@ class BeforeAny:
     def __eq__(self, other):
         return isinstance(other, BeforeAny)
 
+    def __hash__(self):
+        return 1
+
 
 @functools.total_ordering
 class AfterAny:
@@ -247,6 +250,9 @@ class AfterAny:
     def __eq__(self, other):
         return isinstance(other, AfterAny)
 
+    def __hash__(self):
+        return 1
+
 
 class ScoreTest:
     """Argument converter for sorted set score endpoints."""
diff --git a/fakeredis/_zset.py b/fakeredis/_zset.py
index 2a7c090..c6c22d2 100644
--- a/fakeredis/_zset.py
+++ b/fakeredis/_zset.py
@@ -74,8 +74,10 @@ class ZSet:
     def irange_lex(self, start, stop, inclusive=(True, True), reverse=False):
         if not self._byscore:
             return iter([])
-        score = self._byscore[0][0]
-        it = self._byscore.irange((score, start), (score, stop),
+        default_score = self._byscore[0][0]
+        start_score = self._bylex.get(start, default_score)
+        stop_score = self._bylex.get(stop, default_score)
+        it = self._byscore.irange((start_score, start), (stop_score, stop),
                                   inclusive=inclusive, reverse=reverse)
         return (item[1] for item in it)
 

diff --git a/test/test_mixins/test_sortedset_commands.py b/test/test_mixins/test_sortedset_commands.py
index 6350a26..daecdee 100644
--- a/test/test_mixins/test_sortedset_commands.py
+++ b/test/test_mixins/test_sortedset_commands.py
@@ -1164,10 +1164,9 @@ def test_zrangestore(r: redis.Redis):
     assert r.zrangestore("b", "a", 2, 1, byscore=True, offset=0, num=1, desc=True)
     assert r.zrange("b", 0, -1) == [b"a2"]
     # by lex
-    # TODO: fix
-    # assert r.zrange("a", "[a2", "(a3", bylex=True, offset=0, num=1) == [b"a2"]
-    # assert r.zrangestore("b", "a", "[a2", "(a3", bylex=True, offset=0, num=1)
-    # assert r.zrange("b", 0, -1) == [b"a2"]
+    assert r.zrange("a", "[a2", "(a3", bylex=True, offset=0, num=1) == [b"a2"]
+    assert r.zrangestore("b", "a", "[a2", "(a3", bylex=True, offset=0, num=1)
+    assert r.zrange("b", 0, -1) == [b"a2"]
 
 
 @pytest.mark.min_server('7')
diff --git a/test/test_mixins/test_transactions_commands.py b/test/test_mixins/test_transactions_commands.py
index d1abe26..27399b9 100644
--- a/test/test_mixins/test_transactions_commands.py
+++ b/test/test_mixins/test_transactions_commands.py
@@ -318,6 +318,7 @@ def test_get_within_pipeline(r: redis.Redis):
         p.watch("test")
         assert set(r.keys()) == expected_keys
 
+
 @pytest.mark.fake
 def test_get_within_pipeline_w_host():
     r = fakeredis.FakeRedis('localhost')
@@ -329,6 +330,7 @@ def test_get_within_pipeline_w_host():
         p.watch("test")
         assert set(r.keys()) == expected_keys
 
+
 @pytest.mark.fake
 def test_get_within_pipeline_no_args():
     r = fakeredis.FakeRedis()

issue with `ZRANGE` and `ZRANGESTORE` with `BYLEX`.
**Describe the bug**
`BYLEX` does not work as expected. See `test_zrangestore`:
```python
    # TODO: fix
assert r.zrange("a", "[a2", "(a3", bylex=True, offset=0, num=1) == [b"a2"]
assert r.zrangestore("b", "a", "[a2", "(a3", bylex=True, offset=0, num=1)
assert r.zrange("b", 0, -1) == [b"a2"]
```

test/test_mixins/test_sortedset_commands.py::test_zrangestore[FakeStrictRedis]
test/test_mixins/test_sortedset_commands.py::test_zpopmin[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zpopmin_too_many[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zpopmax[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrange_same_score[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrange_with_bylex_and_byscore[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrange_with_rev_and_bylex[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrange_with_bylex[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrange_with_byscore[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zcard[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zcard_non_existent_key[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zcard_wrong_type[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zcount[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zcount_exclusive[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zcount_wrong_type[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zincrby[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zincrby_wrong_type[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrange_descending[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrange_descending_with_scores[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrange_with_positive_indices[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrange_wrong_type[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrange_score_cast[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrank[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrank_non_existent_member[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrank_wrong_type[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrem[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrem_non_existent_member[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrem_numeric_member[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrem_wrong_type[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zscore[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zscore_non_existent_member[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zscore_wrong_type[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zmscore[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zmscore_missing_members[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zmscore_mixed_membership[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrevrank[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrevrank_non_existent_member[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrevrank_wrong_type[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrevrange[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrevrange_sorted_keys[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrevrange_wrong_type[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrevrange_score_cast[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrange_with_large_int[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrangebyscore[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrangebysore_exclusive[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrangebyscore_raises_error[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrangebyscore_wrong_type[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrangebyscore_slice[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrangebyscore_withscores[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrangebyscore_cast_scores[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrevrangebyscore[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrevrangebyscore_exclusive[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrevrangebyscore_raises_error[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrevrangebyscore_wrong_type[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrevrangebyscore_cast_scores[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrangebylex[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrangebylex_wrong_type[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zlexcount[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zlexcount_wrong_type[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrangebylex_with_limit[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrangebylex_raises_error[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrevrangebylex[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrevrangebylex_with_limit[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrevrangebylex_raises_error[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrevrangebylex_wrong_type[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zremrangebyrank[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zremrangebyrank_negative_indices[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zremrangebyrank_out_of_bounds[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zremrangebyrank_wrong_type[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zremrangebyscore[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zremrangebyscore_exclusive[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zremrangebyscore_raises_error[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zremrangebyscore_badkey[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zremrangebyscore_wrong_type[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zremrangebylex[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zremrangebylex_error[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zremrangebylex_badkey[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zremrangebylex_wrong_type[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zunionstore[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zunionstore_sum[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zunionstore_max[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zunionstore_min[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zunionstore_weights[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zunionstore_nan_to_zero[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zunionstore_nan_to_zero2[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zunionstore_nan_to_zero_ordering[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zunionstore_mixed_set_types[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zunionstore_badkey[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zunionstore_wrong_type[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zinterstore[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zinterstore_mixed_set_types[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zinterstore_max[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zinterstore_onekey[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zinterstore_nokey[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zinterstore_nan_to_zero[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zunionstore_nokey[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zinterstore_wrong_type[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_empty_zset[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zpopmax_too_many[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_bzpopmin[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_bzpopmax[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zscan[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zrandemember[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zdiffstore[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zdiff[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zunion[FakeStrictRedis] test/test_mixins/test_sortedset_commands.py::test_zinter[FakeStrictRedis] test/test_mixins/test_transactions_commands.py::test_multiple_successful_watch_calls[FakeStrictRedis] test/test_mixins/test_transactions_commands.py::test_watch_state_is_cleared_after_abort[FakeStrictRedis] test/test_mixins/test_transactions_commands.py::test_pipeline_transaction_shortcut[FakeStrictRedis] test/test_mixins/test_transactions_commands.py::test_pipeline_transaction_value_from_callable[FakeStrictRedis] test/test_mixins/test_transactions_commands.py::test_pipeline_empty[FakeStrictRedis] test/test_mixins/test_transactions_commands.py::test_pipeline_length[FakeStrictRedis] test/test_mixins/test_transactions_commands.py::test_pipeline_no_commands[FakeStrictRedis] test/test_mixins/test_transactions_commands.py::test_pipeline_failed_transaction[FakeStrictRedis] test/test_mixins/test_transactions_commands.py::test_pipeline_srem_no_change[FakeStrictRedis] test/test_mixins/test_transactions_commands.py::test_pipeline[FakeStrictRedis] test/test_mixins/test_transactions_commands.py::test_pipeline_ignore_errors[FakeStrictRedis] test/test_mixins/test_transactions_commands.py::test_pipeline_non_transactional[FakeStrictRedis] test/test_mixins/test_transactions_commands.py::test_pipeline_raises_when_watched_key_changed[FakeStrictRedis] test/test_mixins/test_transactions_commands.py::test_pipeline_succeeds_despite_unwatched_key_changed[FakeStrictRedis] test/test_mixins/test_transactions_commands.py::test_pipeline_succeeds_when_watching_nonexistent_key[FakeStrictRedis] test/test_mixins/test_transactions_commands.py::test_watch_state_is_cleared_across_multiple_watches[FakeStrictRedis] test/test_mixins/test_transactions_commands.py::test_socket_cleanup_watch test/test_mixins/test_transactions_commands.py::test_get_within_pipeline[FakeStrictRedis] test/test_mixins/test_transactions_commands.py::test_get_within_pipeline_w_host test/test_mixins/test_transactions_commands.py::test_get_within_pipeline_no_args