Fix socket errors.