Fixed bug in typechecker.