Fix bugs in ec_table_select_2