Added maximum redirects and default Referer. Fixed #169.