fixed error when constructor not provided stream

tests also updated to support structure