Fix for call to Lucene from internal tasks