Fix a wrong type check in self.new
Merge pull request #838 from kana/fix-typos

Fix a wrong type check in self.new