Fix output path determination.