In the save file, there is a section for "Starting unit type 1" and "starting unit type 2". In a standard game, these are a settler and worker (respectively).
The game rules are hard-coded so that under certain circumstances, you can get a "starting unit type 1" from a goody hut. Swap the two units over, and the units from huts get swapped too.