Fix ordering when there are no threads