Changed handling of redirects
Fixed redirect to empty referer