Add output_dir function params back in.
Put cwd param of subprocess back in.