Backported instance assertion for python 2.6 and fix type error with object.__new__