Fixed logic of the ssh2_tunnel() function