Fix some bugs around the new client code.