fix segfault triggered when carriage return is scanned in first block