Add buffer flushing.