Made some exception handling better for network errors.