Fix last line ignored

Fixed a bug causing the last line to be ignored.