Fix conditional stream logic