Fixed thead/tfoot not inserting into the right locations