Significant .net wrapper fixes