Fix processing of --base-dir and --output-dir options (work in progress)