Java LibXin: fix some bugs