Added checks for interfaces and abstract classes as type argument