Fixed Singleton instance detection code.