fix(ChangeDetector): fix issues with handling empty ranges

`return record === this.headRecord ? null : record;` (tail -> head)