Merge "Error fix from enabling Clang thread-safety checks." into main