Fix stream factory usage and add log