Bug fix relating to Basic HTTP Auth

The commit logs have the details, but the short version is there is an HTTP Auth bug that was causing a crash with the 400 error handler.  With the handler fixed (first commit) the problem with the HttpAuth became obvious, and there is a fix for that too (second commit).