fixed bugs in batch.prepare.pl