more math fixes