Made compatible with the new math library interface.