Fixed bug in client, added error messages.