Fix GetObjectFunction for generics