Fix math functions to account for big and small numbers