More thorough error handling and better batch management.