Additional changes to support thread safety.