Fixing an issue with output parameters that are of type IntPtr