fix a log_exp() bug, some changes