Credentials - FIX #247

* No more invalid Authorization headers (still need to cater for 401)
* Adding a User Agent
* Fixing typos and syntax here and there