Fix minor outdir handling bug to build a proper path for outfile.