[GIT PULL] Optimize the line buffer mode

Please merge the two following commits into your master repository.