Better transaction committing, fixed batch counter