Fix math functions.