Fix generate script