Added flushing to elastic, to make sure all changes are in place before
terminating.