Fixed the combination of --dry-run and --only-write-batch.