Prevent infinite recursion by preventing deduction of types to classes containing them (non-ptr and non-ref)
added some more tests