fix(ChangeDetector): fix issues with handling empty ranges

I also have expectation for getters to do as little as possible. Agreed to keep it as a function.