Add user agent. Fix errors