fix coref batch sorting, and slow log file output