fixup min-stream implementation