adjustments to client to fix some bugs, and provide additional debug/trace logging