Remove trailing spaces
Add user agent