fix(record-range): fixes bug when disabling empty ranges.

Yes, there are optimizations. I was solely concerned with correctness when I wrote this, as it was blocking another PR.  Feel free to submit another PR, also we should write down the invariants (firstEnabledChildRecord is null implies lastEnabledChildRecord is null) in comments, if we plan to optimize based on them.