Documented client and fixed some bugs