Support for x64 IntPtr added

Originally IntPtr is being converted to Int32, what is sometimes wrong in x64 bit environment.