Couple of bugfixes in batch mode.