Casting a 32-bit pointer to a uint64_t sign-extends!

Fixed by casting via uintptr_t