Isolated fix for #3111 out of michel_3111_next_batch. Code review 2152
Merge branch 'v1.15.x' into next
Merge branch 'next' of github.com:rethinkdb/rethinkdb into next