Logging fixes
Fix extremely dirty multi-threading bug