fix mutual recursive types and functions