Fixing bug in handling of client error.