Isolated fix for #3111 out of michel_3111_next_batch. Code review 2152