Switched LocalFree back to Marshal.FreeHGlobal with comment, since it is implemented incorrectly under the hood in the same fashion as Marshal.StringToHGlobalUni.