Fixed bug in type checker