Fix and test for "panic: runtime error: index out of range for" lines that contain just a \n