Fixing a bug when output dir is not specified