Removed faulty reference leftover from the .NET version downgrade.
Removed unused variables, made logging more verbose.