We need to set newend after the content of match is final, otherwise we can end up in an endless loop. This allows us to remove the startoff != latestOff check that previously prevented this endless loop and caused this bug.