Fix LUCENE-5823 bug