Fix exit logging around return stmts