Fix CPU 100% hogging bug, which was happening when file has single line.