More robust check, proper line reading.