Writing a client test..and debug some stuff