Fixed ArrayStream memory leak