Fixed several bugs in type checking component