Thread safety and logging changes