Added exception handling and more logging to the clients.