Fix line-break insertion code. Fix blank-detecting regex.