fixed stream, added test

fixes a little issue with the stream export, adds test to verify