Fixed an error in the generate script