Make output dir optional, verify it exists.