Fix outdir handling