Fixed indentation bug and added better login.

Also allows a user defined useragent now