re #187 : Use while loop to clean output buffer.