Switching -1ULL to UINT64_MAX to fix MSVC warnings.  Patch thanks to Peng Cheng!