Fixed generate_recursive
Fixed generate_recursive