Performance Fixes

Little performance fixes at the .NET classes.