Added patch from Shane, moving toward 64 bit