A slight tweak to the logic that calls log_exit().