Compare self, not self.class to input

Fix bug in my patch cought by the test. Per drbrain.
Since this is a class method self.class is Class, which is unhelpful.