Fixed TypeExtensions.IsSameOrInherits and added some tests

There was a problem in TypeExtensions.IsSameOrInherits which would result in error if you use something like this: