Fixed a memory problem in generated code. Mapped void* to IntPtr