Fix typechecking bug with implicit parameters (Trac #1445)