fix error in takeWithUnfold in Stream