Fixed issue with types.

Comparing types is a bit different in CSharp than Java. May be other places
this exists.