Fixed double free, restored stream functionnality