fix output_dir and merge options