A fix for support of output dir.