fixes to recursive type checking