Pull request to close issue 3061

This pull request closes the following issue:

https://github.com/elasticsearch/elasticsearch/issues/3061