Fixup and improve per-thread data