Fix compilation problem caused by ULONG_MAX.