Fixed the 401 challenge to return error if bad URL is returned. Fixed some tests.
Fix more of the tests