Fix recursive functions in type definitions (closes #105)