Fixed "Exception when no user agent is provided" issue.