Numerous bug fixs and more batching