Fix pointer cast incompatible with 64 bit architectures