Attempt to fix socket errors.