Changed command line flags. Added -o for output dir. Fixed an error.