Some changes to adapt the typechecker of fun