Add some needed typecasts for x64 platform