Fixes stream flush on threshold.