Fix Flatten running in the CLI