Bugfix. Return None if there is no output dir.