Fix exclude bug when using CLI.