Improve check for subcommands.