Made the command line processing a bit cleaner.

Also corrected a couple of things in DexTargetedTask().