Further improvements to the client and to error handling.