Made the output log reordering code work.