fixes small bug in JS driver related to 0 length streams