Final changes to make stream.go library friendly.