Fixing exception throwing in Client.php