Add minor changes to avoid SSL hanging some time