Fix a source of undefined behavior when dealing with 64-bit types. This