Fix a break in the regeneration Function.