Fixes #995. OTS by @atnnn
Merge branch 'next' of github.com:rethinkdb/rethinkdb into next