Casting pointers into fixed-size integers are a big no-no

Fixes crashes in x64