Fixes LOGSTASH-1328

I've tried more or less everything, but this consistently fixes LOGSTASH-1328