[BUGFIX] Streams and session not properly closed