Fixed closing streams