Tighten up the math functions slightly