Fixed various bugs with the client.