Avoid segfault and keep a reference to the Batch.