Function restoreRegions

Restores the regions array, ensuring correct structure and types.