Fix thread logging.