fix some tabledata bugs