Removed LogDebug calls
Updating code to modern syntax
Fixed weird self assignments