Stream mode (fix #1).

I extracted some code from the `get()` inner function because it needed to be run only once.