Do a correct bugfix of typechecking.