It looks good to me that only the second condition. As far as I know, `singleton_class` is instance of  `Class`.
I'll add patch for similar code.