Fix type mismatches in intrinsic functions.