Fix closing table tag and TableQuery type.