fix some Write_Index_List() function and some other problems