Improved error message.
Corrected response for unauthorized client, and so on.