Fixed generate script