Fix the types and implementations of some Prelude functions in the Math module.