Fixed a bug in the .net lib.