Made result printing more reliable.