Fixed bug with reading last line of log file