Fix some bugs and issue after testing tsi server