Added buffer flush feature.