Be more robust for files with incomplete lines