Fixed user-agent name. Better error handling.