Correctly handle output directory argument