fix(ChangeDetector): fix issues with handling empty ranges

I did not use a getter because the operation is not constant time. I think that using a method implies that getting the last enabled record requires some work and thus should be cached.