Changes to threading and logging...