Merge pull request #180 from CipherChen/master

Fixed redirecting with relative URLs in Location header. (Closes #179 and #178)
Update CHANGES.rst
Formatting and comment.
Minor code cleanup.