Fixed line reading error.

This was caused by the lines not being trimmed initially on read.