Fixed command line arguments. Output dir created if doesn't exist.