Fixed client handling of error messages.
Added support for external reset hooks.