Fix for #5579

This is targeted at the beta branch directly, as the streams work in #5522 addressed this in master.

Thanks to @briandunn for this fix.

@mixonic / @mmun - Final review please?