Better empty line detection