Applied https://github.com/elasticsearch/elasticsearch/commit/65fccded8fc7dac3e24c0d8f991e5caef554e2f4.patch