Fix typechecking once and for all