Fix issue where if a system has more than 31 threads on some systems the
compiler would treat 1 as a 32 bit number and wrap.