Fix ruby 1.8 error case due to math_error_classes bug