Improvements on TypeCheck