fixed some issues of NetworkStream and SslStream