Fix clearing buffer in case of one line.