BW merged singleton changes per pull request.

Minor change to singleton behavior to prevent possible thread access issues.