Please note that you did not have to change the field data type from TEXT to INTEGER to get the proper sort.
If you have a field named Sort that is of TEXT type in a table, but contains all integers, you do not have to change the field data type in the table to INTEGER. You can always sort using the CAST function like this: ORDER BY CAST(Sort AS INTEGER). The records will be sorted properly.