Fix for #2499
Merge branch 'daniel_2499' into next
Merge branch 'next' of github.com:rethinkdb/rethinkdb into next