Fixed return type's type parameters not being taken into account.
Changed new method template to raise exception like in ReSharper.