Add stream/pipe unit test + fix other tests