Some more to make the application thread-safe.
More work on thread-safety.