fix some tests
move exp/trig rewriting to end