More robust EOL checking.